2010-07-19 165 views

回答

1

我假設你在談論這一點:

// 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(... 
+0

而且,根據文章,確保它在一個DOM準備好的「包裝器」中... – James 2010-07-19 08:04:25

0

只需添加$('.curtain_wrapper').trigger('click');實際的代碼!