How would I make the 开发者_运维百科window snap to the top of the page on an event in jquery?
This scrolls the window to the top of the page, if that's what you're after...
window.scrollTo(0,0);
I would suggest (edited based on @Aaron's comment):
$("html, body").scrollTop(0);
http://api.jquery.com/scrollTop/
精彩评论