|Duration||When passed, the effects of |
.toggle() are animated; the element(s) will gradually fade in or out.
With specific duration
...or with easing and callback.
...or with a variety of options.
It's also possible to use a slide as animation with
...or fade in/out by changing opacity with
...or toggle a class with
A common case is to use
toggle() in order to show one element while hiding the other (same class)
All the above examples can be found here
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0