ScrollTo动画 [英] ScrollTo with animation
本文介绍了ScrollTo动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何添加缓动/动画/慢慢移动到此功能?
目前它只是跳跃。
现在它应该用动画移动到锚点。
how can i add an easing/animation/slowly moving to this function? At the moment it just jumps. Now it should move to the "anchor" with an animation.
<script type='text/javascript'>
setTimeout("window.scrollBy(0,270);",3000);
</script>
推荐答案
自己搞定。因为wordpress和jquery.noConflict模式我要修改代码:
got it myself. because of wordpress and the jquery.noConflict Mode i hade to modify the code:
<script type="text/javascript">
(function($){
$(document).ready(function(){
setTimeout(function() {
$('body').scrollTo( '300px', 2500 );
}, 3000);
});
}(jQuery));
</script>
感谢所有人!!!
这篇关于ScrollTo动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文