【问题标题】:JQuery easing not functioningJQuery 缓动不起作用
【发布时间】:2016-03-16 19:25:10
【问题描述】:

尝试重新创建:

http://jsfiddle.net/pvq111u9/

它旋转一次 360 度然后停止...缓动函数没有被调用...甚至尝试包括 jquery.easing.min.js ...

<script type="text/javascript" src="http://beneposto.pl/jqueryrotate/js/jQueryRotateCompressed.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<img src="picpath" id="image">
<script type="text/javascript">
  var rotation = function (){
    $("#image").rotate({
      angle:0, 
      animateTo:360,
      callback: rotation,
      easing: function (x,t,b,c,d){
        // t: current time, b: begInnIng value, c: change In value, d: duration
        return c*(t/d)+b;
      }
    });
  }
  rotation();

【问题讨论】:

    标签: javascript jquery animation easing jquery-easing


    【解决方案1】:

    您确定关闭了script 标签吗?为我工作fiddle

    【讨论】:

      【解决方案2】:

      你需要把图片的扩展文件,jquery库和关闭&lt;/script&gt;标签,例子:

      <script type="text/javascript" src="http://code.jquery.com/jquery-2.2.1.min.js"></script>
      <script type="text/javascript" src="http://beneposto.pl/jqueryrotate/js/jQueryRotateCompressed.js"></script>
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
      
      
      <img src="descarga.jpg" id="image">
      
      <script type="text/javascript">
        var rotation = function (){
          $("#image").rotate({
            angle:0, 
            animateTo:360,
            callback: rotation,
            easing: function (x,t,b,c,d){
              // t: current time, b: begInnIng value, c: change In value, d: duration
              return c*(t/d)+b;
            }
          });
        }
        rotation();
        </script>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-03-23
        • 2011-05-20
        • 2016-08-31
        • 1970-01-01
        相关资源
        最近更新 更多