2011-10-29 81 views
0

我正在使用puppybits jQuery插件QTransform旋转/动画元素(https://github.com/puppybits/QTransform)。旋转完成后,除了节目外,我还有其他的工作。QTransform显示/隐藏

下面的代码:

$(document).ready(function(){ 
    $('#rotatehs').hide(); 
    $('#bkgimg') 
     .css('translate', 100) 
     .css('rotate', -1) 
     .animate({rotate: '+=360deg'}, 4000) 
--------------> add show after rotate complete ('#rotatehs') here <-------------- 
}); 

回答

1

添加一个回调到animate

$(document).ready(function(){ 
    $('#rotatehs').hide(); 
    $('#bkgimg') 
     .css('translate', 100) 
     .css('rotate', -1) 
     .animate({rotate: '+=360deg'}, 4000, function() { 
      $('#rotatehs').show(); 
     }); 
}); 
+0

是的,这做的伎俩。谢谢。 – Andrea

+0

不客气。 – scessor