我正在为点击事件的 div 设置动画我想要的是每 0.2 秒后增加动画速度这就是我现在正在做的
<div class='col-md-6 col-sm-6 col-xs-12 animatediv' >
<img src='images/camera.png' alt='camera' class="camera">
<p id='cameras' class='text-danger pull-right'>
interested ? Read more
</p>
</div>
Jquery
$(document).ready(function (){
$('#cameras').click(function(){
$(".animatediv").animate({'position':'relative','left':'700px'}, 2000, function(){
window.location.replace("http://www.google.com");
});
});
});
现在它为整个 div 设置动画,但我想如上所述改变速度,请帮助
最佳答案
Jquery animate 用作.animate( properties [, duration ] [, easing ] [, complete ] )
您可以减少持续时间(以毫秒为单位)以使其显示得更快(您的情况是 2000)
将其减少到 500 或更少。或者您可以使用“快速”代替 2000
关于javascript - 查询 : Increase animation speed during animation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35292913/