jquery - Simulate mouse scroll using only Javascript -


just provide context: want simulate mouse scroll on google photos (photos.google.com).

the page contains scroll bar portion of page (the top "search" section not have scroll bar).

the following not work (but works fine scrolling on facebook, or so):

window.scrollto(0, 10000000) 

any clues on how can simulate mouse scroll ?

if aren't scrolling whole window window.scrollto not want. can scroll section of dom has style of overflow: scroll like:

var scrollbox = document.getelementbyid('sectionid'); scrollbox.scrolltop = 100; // num pixels element top want scroll down 

which same as:

$('#sectionid').scrolltop(100); 

you might want consider library https://github.com/kswedberg/jquery-smooth-scroll scrolls screen in ease-in ease-out fashion, easier users follow.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -