how can I scroll the page with javascript until the scrolled height will be some predefined number of pixels?
function pageScroll() {
// Next line is pseudocode:
if (window.ScrolledHeight != SOME_NUM)
window.scrollBy(0,50);
}
scrolldelay = setTimeout('pageScroll()',100);
There should be some logical checking of something. Could you help me, how to get scrolled height?
Could you use a variable outside of the function that would increment the value by 50 pixels everytime pageScroll ran and then check to see if that is equal to or greater than the value you are looking for?
e.g.
You could also make the function take in a parameter that you modify if you don’t want to use the global variable.