旋转后Jquery隐藏图像

时间:2012-10-16 22:24:26

标签: javascript jquery rotation hide

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

$("#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>

任何帮助都会很棒。谢谢!

1 个答案:

答案 0 :(得分: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();
        },
     }

});