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();} );
});
精彩评论