.dequeue(\"queuename\") to start it.","type":[{"name":"Boolean"},{"name":"String"}],"name":"queue","default":"true"},{"desc":"A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions.","name":"specialEasing","type":"PlainObject","added":"1.4"},{"desc":"A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set.","argument":[{"desc":"The numeric value of the property being animated at each step","name":"now","type":"Number"},{"desc":"An object of properties related to the animation and the element being animated. For information about the tween object and its properties, see Hello
\nGood Bye
\n"},{"desc":"Animates all paragraphs to be shown if they are hidden and hidden if they are visible, completing the animation within 600 milliseconds.","code":"\n$( \"button\" ).click(function() {\n $( \"p\" ).toggle( \"slow\" );\n});\n","css":"\n p {\n background: #dad;\n font-weight: bold;\n font-size: 16px;\n }\n","html":"\n\nHiya
\nSuch interesting text, eh?
\n"},{"desc":"Shows all paragraphs, then hides them all, back and forth.","code":"\nvar flip = 0;\n$( \"button\" ).click(function() {\n $( \"p\" ).toggle( flip++ % 2 === 0 );\n});\n","html":"\n\nHello
\nGood Bye
\n"}],"longdesc":"\nNote: The event handling suite also has a method named .toggle(). Which one is fired depends on the set of arguments passed.
\nWith no parameters, the .toggle() method simply toggles the visibility of elements:
\n$( \".target\" ).toggle();\n \n The matched elements will be revealed or hidden immediately, with no animation, by changing the CSS display property. If the element is initially displayed, it will be hidden; if hidden, it will be shown. The display property is saved and restored as needed. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.
When a duration, a plain object, or a single \"complete\" function is provided, .toggle() becomes an animation method. The .toggle() method animates the width, height, and opacity of the matched elements simultaneously. When these properties reach 0 after a hiding animation, the display style property is set to none to ensure that the element no longer affects the layout of the page.
Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.
As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.
If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.
We can animate any element, such as a simple image:
\n\n<div id=\"clickme\">\n Click here\n</div>\n<img id=\"book\" src=\"book.png\" alt=\"\" width=\"100\" height=\"123\">\n \n We will cause .toggle() to be called when another element is clicked:
\n$( \"#clickme\" ).click(function() {\n $( \"#book\" ).toggle( \"slow\", function() {\n // Animation complete.\n });\n});\n \n With the element initially shown, we can hide it slowly with the first click:\n
\n\n
\n
\n
\n
\n
A second click will show the element once again:
\n\n
\n
\n
\n
\n
The second version of the method accepts a Boolean parameter. If this parameter is true, then the matched elements are shown; if false, the elements are hidden. In essence, the statement:\n
\n$( \"#foo\" ).toggle( showOrHide );\n \n is equivalent to:
\n\nif ( showOrHide === true ) {\n $( \"#foo\" ).show();\n} else if ( showOrHide === false ) {\n $( \"#foo\" ).hide();\n}\n \n "}]}