jquery.animate:jQuery animate 的简单覆盖,允许将属性作为动态值的函数传递

时间:2021-07-02 12:53:35
【文件属性】:
文件名称:jquery.animate:jQuery animate 的简单覆盖,允许将属性作为动态值的函数传递
文件大小:2KB
文件格式:ZIP
更新时间:2021-07-02 12:53:35
JavaScript jquery.animate jQuery animate 的简单覆盖,允许将属性作为动态值的函数传递。 例如,如果您有一个容器需要滚动到特定元素,但容器的其他子元素正在切换,则容器所需的 scrollTop 将在动画完成之前更改。 现在我们可以为 scrollTop 或任何其他属性传递一个函数。 $('#container').animate({ scrollTop: function(){ return $('#container').scrollTop() + $('#container .item.selected').position().top; } }); 示例: :
【文件预览】:
jquery.animate-master
----jquery.animate.js(2KB)
----README.md(622B)
----bower.json(123B)

网友评论