需要Jquery动画帮助


jquery animate help needed

我在jQuery中使用动画。我在执行动画时会遇到问题。它在测试函数之后执行我想在测试函数

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

但是现在当我点击下一个类时,我的测试函数首先执行,我想在执行animate之后执行。

尝试将其放入回调函数

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

应该可以:

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