#Toggle Anything
A versatile little jQuery script for using any way you like.
Here's how to use it:
-
All you need to do is add an
id=""
to any element you wish to make toggleable in your HTML. -
Then on another element (e.g. a SPAN styled as a button)
- add
data-toggle-id=""
pointing to the ID of your toggleable element - add
data-toggle-class=""
to set the class that you wish to be added/removed on the toggleable element
-
Style your toggleable element's two states (without and with its toggled class).
-
[Optional:] there is a class
.is-toggled
that is added/removed on the toggler (e.g. SPAN). You can style that too if necessary.
Use CSS3 animations for best results.