I put the toggle on the list li it all disappears! I read on the Internet that this function was removed.

1 answer 1

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 '