toggle()The method can bind two or more than two functions in the element's click event, and it can also implement the toggle between hiding and displaying the element, and the calling format for binding multiple functions is as follows:
$(selector).toggle(fun1(),fun2(),funN(),...)
Where Fun1,fun2 is the name of multiple functions
For example, use a toggle() method that displays different content each time you click the <div> element, as shown in:
Effects displayed in the browser:
As you can see, each time you click on the <div> element, you execute the toggle() function of the method binding sequentially, and when you execute to the last function, clicking again will return to executing the first function.
Note: the toggle () method supports the current mainstream stable jquery version of 1.8.2, which is not supported in versions after 1.9.0.
13. Use the Toggle () method to bind multiple functions