Posted By

satie83 on 06/14/13


jquery callback toogleClass

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


jQuery - Function on toggleClass complete

 / Published in: jQuery


How can I do a function once a toggleClass has completed?

The .toggleClass method along with all other animation methods return a deferred object that you can access using .promise(). At that point, you can bind to it's done method.

  1. $("#loader").toggleClass('fadeOut',600).promise().done(function(){
  2. alert('a');
  3. });

Report this snippet  

You need to login to post a comment.