I put the toggle on the list li it all disappears! I read on the Internet that this function was removed.
- What kind of .toggle () ? The one that binds two or more handlers ? Yes, a long time ago. And the one that displays / hides the elements - it seems to be alive and well even in versions 2.x. - Deonis
- Hmm, but in the official dock it isn’t so marked with api.jquery.com/toggle - RubaXa
|
1 answer
The toggle
function used to hide and show elements is also in the most current version of jQuery: Effects> Basics> toggle .
If you are about the event-related toggle
function, which allows you to hang several handlers, in particular for each even / odd click, then it is considered obsolete since jQuery 1.8, and was removed in version 1.9: Deprecated> Deprecated 1.8 | Events> Mouse Events | Removed
Apparently you are trying to use the event-related toggle
function, but connect jQuery versions above 1.8. Alternatively, you can hang the handler on the click
event, and store in the data
of the special element. flag.
- Yes thank you! That's exactly what he did - trix
- You can also create an array of functions (you can add it to data) and make it array.push (array.shift); jsfiddle.net/oceog/PETqD - zb '
|