jQuery.animate
功能存在一些问题。
我在我的网站上实现了一个“返回顶部”链接:http ://www.unforgivengamers.com/
一旦您单击它,它应该会让您回到页面顶部。
这是我的 jQuery 代码:
<script type="text/javascript">
jQuery.noConflict();
jQuery('a[href=#top]').click(function(){
jQuery('html, body').animate({scrollTop:0}, 'slow');
return false;
});
</script>
问题:动画不流畅!我希望它慢慢滚动,而不是瞬间滚动。
像这样:http ://designwoop.com/labs/smooth%20scroll/smooth-scroll.html
我在这里错过了什么吗?
我正在使用 jQuery 1.8.3