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

SAP Web Service from .NET via WCF -

Optimized Line drawing in QT -

datetime - str to time in python -