javascript - 查询 : Increase animation speed during animation

标签 javascript jquery html css animation

我正在为点击事件的 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/

相关文章:

javascript - 如何隐藏/显示 Bootstrap 网格中的元素并更新位置

javascript - 根据 xml 解析返回的数据编写条件

javascript - 在 JQuery 中使用数组添加和删除表的元素

javascript - 有没有办法在没有事件的情况下找到鼠标在屏幕上的当前位置?

html - div ul >li 保持在一行内(横线)

javascript - 使用 jQuery/javascript 更改 html 文本

javascript - 为什么这个 for 循环返回字符的索引而不是整个属性?

javascript - 搜索功能在 IE 中不起作用

javascript 缺少 ) 参数

javascript - 是否可以将JSON格式的数据发送到没有表单的服务器?