I have a DIV on my page that I want to be able to toggle cards/divs to fadeIN & Out of.
The broken code:
$('.toogle-link').live('click', function() {
var toogleID = $(this).attr("name");
$('.carditem').fadeOut( function() {
// Animation complete show correct card
$('#' + toogleID).fadeIn();
});
return false;
});
Problem is the FadeIn is happening before the fadeOut completes which is causing the cards to stack for a moment which looks horrible versus the current card fading out and the new card fading in. Any ideas?