我正在使用jQuery動畫。我需要在網站打開時自動啓動動畫。 但在這個jQuery程序員把點擊功能。我想刪除點擊功能。但是當我刪除函數後,所有的動畫都停止了 。jquery點擊事件動畫
http://web.enavu.com/tutorials/curtains-opening-animation-with-jquery/
我正在使用jQuery動畫。我需要在網站打開時自動啓動動畫。 但在這個jQuery程序員把點擊功能。我想刪除點擊功能。但是當我刪除函數後,所有的動畫都停止了 。jquery點擊事件動畫
http://web.enavu.com/tutorials/curtains-opening-animation-with-jquery/
我假設你在談論這一點:
// when user clicks inside the container...
$('.curtain_wrapper').click(function(){
//..animate the description div by changing it's left position to it's width (but as negative number)...
$(this).children('.description').animate({'left': -1*$(this).width()});
//...animate the 2 curtain images to width of 50px with duration of 2 seconds...
$(this).children('img.curtain').animate({ width: 50 },{duration: 2000});
//...show the content behind the curtains with fadeIn function (2 seconds)
$(this).children('.content').fadeIn(2000);
});
嘗試改變字click
,爲each
:
$('.curtain_wrapper').each(...
只需添加$('.curtain_wrapper').trigger('click');
實際的代碼!
而且,根據文章,確保它在一個DOM準備好的「包裝器」中... – James 2010-07-19 08:04:25