Page 1 of 1

Scroll Slowly to Bottom

Posted: Thu Nov 19, 2020 8:11 pm
by webmaster
There are pages where the content won't load until we scroll down to where the content is located, and scrolling all the way to the bottom of the page at once sometimes fails to load the content. This premade scrolls slowly to the bottom of the page so all content is loaded.

It takes a speed argument, which sets the number of pixels to scroll per second and defaults to 2500. To use this on your project, follow these instructions.

Code: Select all

function (speed)
   State.Child
      ·  Browser.RunScript
            ·  "var e=null,o=()=>{var n=element.scrollTop;element.scrollTop+=argument/100,n<element.scrollTop?setTimeout(o,10):e()};return setTimeout(o,10),new Promise(o=>e=o)"
            ·  speed
If the scrollable area is not the whole page, add a selector that selects the scrollable element above this action:

Code: Select all

Select.ScrollableElement
ScrollSlowlyToBottom
   ·  2500