2011-10-29 79 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