Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

45 lines (44 sloc) 1.485 kB
<?xml version="1.0"?>
<entry name="toggle" type="method" return="jQuery">
<title>.toggle()</title>
<desc>Display or hide the matched elements, using custom effects.</desc>
<longdesc>
<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</longdesc>
<signature>
<argument name="effect" type="String">
<desc>A string indicating which <a href="/category/effect/">effect</a> to use for the transition.</desc>
</argument>
<argument name="options" type="Object" optional="true">
<desc>Effect-specific settings and <a href="/easings/">easing</a>.</desc>
</argument>
<xi:include href="../includes/animation-argument-duration.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/animation-argument-complete.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</signature>
<xi:include href="../includes/animation-signature-options.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<example>
<height>150</height>
<desc>Toggle a div using the fold effect.</desc>
<css><![CDATA[
div {
width: 100px;
height: 100px;
background: #ccc;
border: 1px solid #000;
}
]]></css>
<html><![CDATA[
<button>toggle the div</button>
<div></div>
]]></html>
<code><![CDATA[
$( "button" ).click(function() {
$( "div" ).toggle( "fold", 1000 );
});
]]></code>
</example>
<category slug="methods"/>
<category slug="effects"/>
<category slug="effects-core"/>
<category slug="overrides"/>
</entry>
Jump to Line
Something went wrong with that request. Please try again.