How would I make the window snap to the top of the page on an event in jquery?
+1
A:
This scrolls the window to the top of the page, if that's what you're after...
window.scrollTo(0,0);
El Yobo
2010-04-08 09:49:25
+1
A:
I would suggest (edited based on @Aaron's comment):
$("html, body").scrollTop(0);
karim79
2010-04-08 09:54:34
Note that this doesn't work for some browsers. If it doesn't, use `$("body")` (or scroll both just to be sure).
Aaron Digulla
2010-04-08 10:02:23