0

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

codr
  • 889
  • 3
  • 13
  • 22

2 Answers2

0

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

gregdevs
  • 703
  • 2
  • 11
  • 37
0

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>
JeuryInc
  • 79
  • 5