连续旋转图像

pri*_*iya 1 jquery rotation image-rotation

我想在我的网站上放置旋转徽标.我的意思是它应该不断旋转.我试过用jquery这样做.请看看,并建议我在哪里出错.为什么这段代码不起作用.请帮我

var rotation = function (){
   $("#img").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();
Run Code Online (Sandbox Code Playgroud)

我在我的html中使用过这段代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="jquery-1.4.4.js"></script>
<script type="text/javascript" src="jquery.easing.1.3.js"></script>
<script type="text/javascript">
var rotation = function (){
   $("#img").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>


<title>Untitled Document</title>
</head>

<body>


<img src="LMIH_LOGO.png" width="174" height="322" name="img" id="img" />
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

它不起作用.请有人帮帮我

max*_*son 5

jQuery没有.rotate()函数.我认为你的意思是包括jQuery Rotate插件.

  • 不仅如此,但在他调用他的东西的时候,DOM还没准备好. (3认同)