簡體   English   中英

jQuery緩動不起作用

[英]JQuery easing not functioning

嘗試重新創建此:

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();

您確定關閉了script標簽嗎? 工作對我來說小提琴

您需要放置圖片的擴展文件,jquery庫和close </script>標記,例如:

<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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM