Calling Code after toggleClass
This fiddle will be helpful when some one want to have callback function just after toggleClass function
by Bharat Sewani
HTML
<div id="loader">Loader Div</div>
CSS
#loader {
color: green;
height:100px;
width:100px;
background-color:black;
color:white;
padding-top:65px;
padding-left:37px;
}
.in { background-color: blue!important; }
JavaScript
$('div').click(function() {
$('#loader').toggleClass('in', 1000).promise().done(function(){
if(!$(this).hasClass('in'))
{
$(this).css('margin-left','100px');
}
else
{
$(this).removeAttr('style');
}
});
});