I have an issue where my animations work perfectly, however when the .hide(); is triggered it just reverts back to the slideDown(); function.
I’m scratching my head over it, though i’m assuming it’s running the animation because the previous click is still active?
$('div.SocialShareJob').on('click', function(){
$(this).find('p').slideUp(300).fadeOut(500);
$(this).find('.Icons').slideDown(500).fadeIn(900);
});
$('div.CloseSharing').on('click', function(){
$(this).parent('div.Icons').hide();
});
You’ll need to stop the animations that haven’t completed, and clear the queue:
If the
closeSharingdiv is a child of the other one, you may also need to stop theclickevent from propagating to the parent. To do this, addevent.stopPropagation()to the start of the event handler: