2012-08-29 28 views
0

我需要旋转使用jQuery的jQuery的onmouseover功能

file.js

$("#logo").rotate({ 
     bind: 
     { 
      mouseover: function() 
      {$(this).rotate({ animateTo: 180 })}, 
      mouseout: function() 
      {$(this).rotate({ animateTo: 0 })} 
     } 
}); 

HTML

<script type="text/javascript" src="../script/file.js"></script> 
<img id="logo" src="../images/logo.png" alt="none" /> 

有什么不对这个代码的图像的onmouseover功能?顺便说一句,我在互联网上找到了这个代码。 在JavaScript中没有函数调用rotate(),那么它如何工作?请给任何链接,以便我能理解。

如果它看起来像一个愚蠢的事情要问:)

+0

为您http://jsfiddle.net/Db3CW/ – deltree

+0

http://stackoverflow.com/questions/7936396/jquery-rotate-transform – disperse

回答

1

.rotate()不是一个函数请忽略这个问题。你是否引用了任何插件,这是正确的? 这一定是导致问题的原因。

+0

我需要调用从图像功能的onmouseover() 又该提琴我用rotate()替换然后呢? –