I have an slider animation but on clX.click event #close div hides before it is animated -250px left. How to wait till the animation completes and then hide #close div?
@hasan, methinks @patxi meant $(this)
var closeable = $('#close'); $('#clx').bind('click', function(){ // $(this) === $('#clx') closeable.stop().animate({marginLeft:'-250px'},{ duration: 500, complete: function(){ $(this).hide(); // $(this) === closeable; } }); });