2012-03-27 74 views
0
<script type="text/javascript" src="http://jqueryrotate.googlecode.com/svn/trunk/jQueryRotate.js"></script> 
<img src="https://www.google.com/images/srpr/logo3w.png" id="image"> 
<button id ="left">left</button> 
<button id ="right">Right</button> 



     $("#left").click({ 
      $("#image").rotate({ animateTo:180 }) 

     }); 

     $("#right").click({ 
      $("#image").rotate({animateTo:0}) 
     });​ 

荫不能旋转的按钮如何旋转的按钮,如左侧和右侧采用旋转插件

回答

1

你必须绑定到事件的函数(里面的“点击”图像的图像在这种情况下)

$("#left").click(function() { 
      $("#image").rotate({ animateTo: 180 }); 

}); 

$("#right").click(function() { 
      $("#image").rotate({ animateTo: 0 }) 
});​ 
相关问题