Questions tagged [js-scrollby]

The Window.scrollBy() method scrolls the document in the window by the given amount.

The Window.scrollBy() method scrolls the document in the window by the given amount.

  • Syntax:

    • window.scrollBy(x-coord, y-coord)
    • window.scrollBy(options)
  • Parameters:

    • x-coord is the horizontal pixel value that you want to scroll by.
    • y-coord is the vertical pixel value that you want to scroll by.
    • options is a ScrollToOptions dictionary.
  • Examples:

    • To scroll down one page:

      window.scrollBy(0, window.innerHeight);
      
    • To scroll up one page:

      window.scrollBy(0, -window.innerHeight);
      
  • Reference: Window.scrollBy()

14 questions
14
votes
2 answers

What is the difference between the different scroll options?

I have tried a few ways of adding scrolling to tables, but just one of them works correctly. What is the difference between them? First: JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("arguments[0].scrollIntoView();",…
3
votes
2 answers

scrollBy() invoked through execute_script is not working on chrome store page using Selenium and Python

I'm using selenium with python 3 and Chrome driver. I'm trying to perform a scroll in a chrome store URL. This one: https://chrome.google.com/webstore/detail/online-game-zone-new-tab/abalcghoakdcaalbfadaacmapphamklh No matter what I tried - the…
Oron Werner
  • 1,211
  • 1
  • 7
  • 14
1
vote
0 answers

Problem with window.scrollBy in IOS browsers

I have written a javascript smooth scrolling function to provide navgation on a one-pager. The code is basically like the one at the bottom. The function is called with the number of pixels to scroll by, which is then divided into 30 steps and then…
RK234
  • 11
  • 3
0
votes
1 answer

javascript scrollBy not scroll decimal numbers

document.getElementById('idcardsliderScroll').scrollBy(399.4, 0 ); // result scroll 399px and document.getElementById('idcardsliderScroll').scrollBy(399.5, 0 ); // result scroll 400px I need to ScrollBy the decimal number without rounding, is it…
0
votes
0 answers

scrollBy does not work for the left scroll in full window size

I have a right arrow and a left arrow which scrolls the carousel via scrollBy. The right scroll seems to work fine in all situations but the left scroll does not work in the full sized window(although it works in any other window sizes weirdly). I…
Aritra Roy
  • 14
  • 1
0
votes
0 answers

ScrollBy and scrollTo conflicting with browser scrolling

I have created a simple carousel based on a native browser scrolling behaviour with the use of scroll-behavior: smooth; and scroll-snap technique. Works perfectly and is progressively enhanced. I trigger the carousel with js with scrollBy and…
Rych
  • 103
  • 7
0
votes
1 answer

Text cursor problem when inserting characters into a contenteditable element

There is a pre element that is contenteditable. I wanted to add tab character via TAB button. So, I added js method called putTab. This method works fine. But there is a problem about text cursor. While typing normally, the view is constantly…
shalom
  • 191
  • 1
  • 1
  • 10
0
votes
1 answer

ScrollTo / ScrollBy in Chrome

Do any of you know why scrollTo and scrollBy methods in Chrome are not working. In other browsers eg Firefox it works. I can fix the issue by adding a setTimeout. An eventListener like load or DOMContentloaded is not working. Thanks and…
Kat
  • 61
  • 3
0
votes
2 answers

How to move up and down by pressing the button without scrolling

The button will operate after scrolling, but it will not work if you press the button before scrolling starts. Is there a way to solve it? I'm trying to make a screen that I can only see on my cell phone. If it doesn't work, can we do it in a way…
katamela
  • 21
  • 4
0
votes
1 answer

How to scroll to the bottom of page using selenium python?(using find_element_by_xpath())

I am trying to scroll the page using scrollBy function but it is not applicable as I am using XPath to find the element(find_element_by_xpath("//div[@class='sc-bGbZqa carTxV']")Inspect in chrome with out adding Id. But while inspecting in chrome…
0
votes
2 answers

The method executeScript(String, Object[]) in the type JavascriptExecutor is not applicable for the arguments (String, WebElement) error with Selenium

Below is the code: JavascriptExecutor jse = (JavascriptExecutor)driver; WebElement blueray = driver.findElement(By.xpath("Xpath ID")]")); jse.executeScript("scroll(0,250)", blueray); Below is the error: The method executeScript(String, Object[]) in…
0
votes
1 answer

Window scroll by only working on one element

I am wondering if someone can help me alter this code so that it resets or works with multiple elements? On the website below I have this script set up to scroll right by 100vw Using the window.scrollBy(window.innerWidth /1, 0); when the purple box…
0
votes
1 answer

Scroll down X pixels slowly in Java Script

I'm trying to make something in HTML for school that scrolls down to the next section when the down arrow is pressed. Currently, the site scrolls down the number of pixels outputted by ((window.innerHeight+(window.innerHeight*0.1))+1). Here is my…
Andereoo
  • 834
  • 1
  • 8
  • 24
0
votes
0 answers

'ScrollBy' on an iframe to produce an infinitely looping embedded webpage

I'm a real amateur when it comes to coding. I'm trying to embed a webpage into a dashboard, just using notepad to write the HTML, got some, but limited, coding experience. The webpage I'm embedding has fixed items down the page, and so far I've…
Dom
  • 1
  • 1