Skip to content
Advertisement

Show and hide with CSS animation

My goal is to create an animation when showing and hiding an HTML element. The show and hide is triggered by a button that toggles a class hide.

Here is my code:

JavaScript
JavaScript
JavaScript

Advertisement

Answer

just remove the display: block from your hide and if you want animated went div show add the animation too:

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement