How to animate a dropdown menu using CSS3 animations?
I would like to add a CSS3 effect to my dropdown. (Just like that one in Instagram.com on “My profile”).
I’m using Animate.css for the CSS3 effects.
I tried this, but it doesn’t work.
You can find a live version on Zapping.io
I got it working in an example. I used the HTML you provided, and then downloaded the
bounceInDown animation and used that for the CSS in the examples below.
jsFiddle example here - hover method
If you want to add a delay when hovering off, use something like this:
jsFiddle example - hover method with delay.
Those examples are assuming you want the animation fired on hover. If you want it fired on click, use something like this instead:
jsFiddle example click method - Look below for an alternative non-JS method.
Alternative method - No JS/jQuery
This essentially toggles between
:checked, thus activating the animation.
jsFiddle example - It works in all current browsers.
CSS - (only part of it) See the example above for full CSS.