开发者

jquery animate help needed

I am using animate in jQuery. I am getting problem to execute animate. It executes after test function I want to run this before test function

 $('.next').live('click',function() {
                    $('.ac_bgimage').animate({
                        left:"-100em"    
                    }, 15000 );
                    test();
                });

but now when i 开发者_高级运维click on next class my test function execute first , i want to execute later after execution of animate.


try to put it into callback function

 $('.next').live('click',function() {
        $('.ac_bgimage').animate({
           left:"-100em"    
        }, 15000 , function(){
           test();
        });                
  });


This should work:

   $('.next').live('click',function() {
                $('.ac_bgimage').animate({
                    left:"-100em"    
                }, 15000, function() { test();} );
            });
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜