I have multiple functions the do different animations to different parts of the HTML. I would like to chain or queue these functions so they will run the animations sequenti
@TrippRitter gotta attach .call to the callback
One = function(callback){
$('div#animateTest1').animate({ left: '+=200' }, 2000, function(){
if(typeof callback == 'function'){
callback.call(this);
}
});
}
Two = function(){
$('div#animateTest2').animate({ width: '+=200' }, 2000);
}
One(function(){
Two();
});
but its is the same as doing the following
$('div#animateTest1')
.animate({ left: '+=200' }, 2000,
function(){
Two();
});
Two = function(){
$('div#animateTest2').animate({ width: '+=200' }, 2000);
}