I am trying to animate a smooth transition of simply showing and hiding a div through fadeIn + zoom.
I'm adding a class ('hide') to div1, while removing a class ('hide') from div2 so that when you click div1 - it disappears while div2 fades and zooms into view.
HTML
<div class="parentWrapper">
<div class="div1">HELLO</div>
<div class="div2 hide">GOODBYE</div>
</div>
JS
$('.div1').on('click', function() {
$(this).addClass('hide', 1000);
$(this).parent().find('.div2').removeClass('hide', 1000);
}
The class 'hide' is inherited from bootstrap...but the above does not work...why?!
Note, the reason I'm using $(this).parent().find() instead of just $('div2') is because in my actual code , there are 2 divs with the same class names. I need to make sure I'm animating the correct divs that the user is interacting with rather than the other separate set of div1+2.
displaytononewhich cannot be aniated