2012-10-16 39 views
0

我有一个图像,在点击事件中旋转360。图像旋转完成后,我希望图像消失。有什么建议么?jquery旋转后隐藏图像

$("#refresh").rotate({ 
    bind: 
    { 
     click: function(){ 
      $(this).rotate({ angle:0,animateTo:720,easing: $.easing.easeInOutExpo }); 
      $(this).fadeOut("slow"); 
     } 
    } 

}); 

HTML

<div class="span4" style="float:right"> 

    <img src="assets/img/refresh_btn.png" id="refresh" width="70" height="70"/> 

</div> 

任何帮助将是巨大的。谢谢!

+0

对不起,我不想使用淡出功能,只是让它旋转,然后隐藏。谢谢! – Mac10

+0

是'jQuery.fn.rotate'你有的一些插件还是只是伪代码?感谢Jacob,感谢 –

回答

0

我假设你正在使用它? http://code.google.com/p/jqueryrotate/wiki/Documentation

在这种情况下,请使用完成时触发的回调。像这样的:

$("#refresh").rotate({ 
    bind: 
    { 
     click: function(){ 
      $(this).rotate({ angle:0,animateTo:720,easing: $.easing.easeInOutExpo }); 
      $(this).fadeOut("slow"); 
     }, 
     callback: function(){ 
      $(this).hide(); 
     }, 
    } 

}); 
+0

!为我工作一点点调整!应该想到那个自己! – Mac10