javascript - Set scroll position -


i'm trying set scroll position on page scroller scrolled way top.

i think need it's not working:

(function () { alert('hello'); document.body.scrolltop = 0; } ()); 

any ideas?

you can use window.scrollto(), this:

window.scrollto(0, 0); // values x,y-offset 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -