【发布时间】:2012-03-05 21:21:18
【问题描述】:
jQuery 的.animate({ scrollTop: '0' }, 600 }); 将iOS 滚动到页面顶部,但不会滚动到绝对顶部(显示地址栏)。有什么办法可以打鹅吗?
谢谢!
【问题讨论】:
标签: jquery ios scroll jquery-animate
jQuery 的.animate({ scrollTop: '0' }, 600 }); 将iOS 滚动到页面顶部,但不会滚动到绝对顶部(显示地址栏)。有什么办法可以打鹅吗?
谢谢!
【问题讨论】:
标签: jquery ios scroll jquery-animate
$('body').scrollTop(0); 将页面的滚动位置设置为页面顶部,而$('body').scrollTop(); 将返回当前滚动位置。
【讨论】:
// Will scroll to the top and will show the address bar
$('body').scrollTop();
// Will scroll to the top and won't show the address bar
$('body').animate({ scrollTop: '0' }, 0)
【讨论】: