Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger event after slideUp or slideDown is completed

Tags:

jquery

I'm doing a simple slideUp animation on an object. I want to add attribute tag to the the element after animation completes. How can i get this to work ?

if($(this).is(':visible')) {
  if(config.animate=='true')                    
    $(this).slideUp(options.animationTime);   //After animation ends do $(this).attr('shown','true');
  else 
    $(this).hide();             
}
like image 556
user1184100 Avatar asked Apr 06 '12 06:04

user1184100


1 Answers

$(this).slideUp(options.animationTime, function() {
    $(this).attr('shown','true');
}); 
like image 197
David Nguyen Avatar answered Oct 20 '22 19:10

David Nguyen