2010-07-19 119 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');实际的代码!