开发者

Snap to top of window in jquery

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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜