How can I do a function once a toggleClass has completed? I've tried the following but with no luck:

$("#loader").toggleClass('fadeOut', function () {
    alert('a');
});
Edit
Report