How can I get an ajax request (that is triggered by a click event) wait for an animation to complete (which is also triggered by the same click event) before it runs the ajax request?
e.g. this is what I'd like to do: $('.ajax-div-slide').click(function (){ $('#ajax-div').ajaxSend(function(){ $('#ajax-loader').animate({height: 375}, 2000); }); //only start the ajax once the animation has finished $('#ajax-div').load(this.href); return false; }); As well as the above example, I've also tried: $('.ajax-div-slide').click(function(){ var passClick = $(this) $('#ajax-loader').animate({height: 375}, 'slow', function(passClick){ $('#ajax-div').load(passClick.href); }); return false; }); ...and... $('.ajax-div-slide').click(function (){ $this($('#ajax-loader').animate({height: 375}, 2000, function(){ $('#ajax-div').load(this.href); }); ); return false; }); ...without any success. Anyone have any ideas as to how I can achieve this? Cheers. -- View this message in context: http://www.nabble.com/Event-%3EAJAX-wait-before-animation-completes-tf3412929.html#a9509661 Sent from the JQuery mailing list archive at Nabble.com. _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/