“ScrollIntoView” Respostas de código

JavaScript role para o fundo da div

//scroll to the bottom of "#myDiv"
var myDiv = document.getElementById("myDiv");
    myDiv.scrollTop = myDiv.scrollHeight;
Grepper

ScrollIntoView

const assert = require('assert')

describe('v5.webdriver.io', () => {

    it('should demonstrate the scrollIntoView command', async () => {

        await browser.url('https://v5.webdriver.io');

        const GitHub = await $('#footer [href="https://github.com/webdriverio/webdriverio"]')
        await GitHub.scrollIntoView();// scroll to specific element

        await browser.pause(4000);


    })    
    
    it('should demonstrate the scrollIntoView command', async () => {

        await browser.url('https://v5.webdriver.io');
        const getstarted = await $('[src="https://badge.fury.io/js/webdriverio.svg"]')
        await getstarted.scrollIntoView();// scroll to specific element

        await browser.pause(4000);
    
    })



})
Vivacious Vicuña

Respostas semelhantes a “ScrollIntoView”

Procure respostas de código populares por idioma

Procurar outros idiomas de código