2012-08-29 18 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()替換然後呢? –