简体   繁体   中英

JQuery easing not functioning

Trying to recreate this:

http://jsfiddle.net/pvq111u9/

It rotates once 360 degrees then stops ... the easing function isn't being called ... even tried including 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();

Are you sure you closed your script tag? working for me fiddle

You need to put the extension file of the picture, the jquery library and the close </script> tag, Example:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM