开发者

jquery animate help needed

开发者 https://www.devze.com 2023-04-09 05:29 出处:网络
I am using animate in jQuery. I am getting problemto execute animate. It executes after test function I want to run this before test function

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

精彩评论

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

关注公众号