开发者

Jquery click event animation

I am using jQuery animation. I need to start the animation automatic when the site open. but in this jQuery programmer put Click function. I want to remove the click function. But after I remove the fu开发者_如何学JAVAnction all animation are stopped.

http://web.enavu.com/tutorials/curtains-opening-animation-with-jquery/


I assume you're talking about this:

// 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);  

});  

Try changing the word click, for each:

$('.curtain_wrapper').each(...


Just add $('.curtain_wrapper').trigger('click'); to the actual code !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜