是否可以使用jQuery动画scrollTop? [英] Is it possible to animate scrollTop with jQuery?
本文介绍了是否可以使用jQuery动画scrollTop?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想顺利向下滚动。我不想为此编写一个函数 - 特别是如果jQuery已经有了。
I want to smoothly scroll down. I do not want to have to write a function for that - especially if jQuery already has one.
推荐答案
你可以使用< a href =http://api.jquery.com/animate/ =noreferrer> .animate()
scrollTop
属性,如下所示:
You can just use .animate()
the scrollTop
property, like this:
$("html, body").animate({ scrollTop: "300px" });
这篇关于是否可以使用jQuery动画scrollTop?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文