我正在使用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