/
effect.xml
42 lines (42 loc) · 1.64 KB
/
effect.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0"?>
<entry name="effect" type="method" return="jQuery">
<title>.effect()</title>
<desc>Apply an animation effect to an element.</desc>
<longdesc>
<p>The <code>.effect()</code> method applies a named animation <a href="/category/effects/">effect</a> to an element. Many effects also support a show or hide mode, which can be accomplished with the <a href="/show/"><code>.show()</code></a>, <a href="/hide/"><code>.hide()</code></a>, and <a href="/toggle/"><code>.toggle()</code></a> methods.</p>
</longdesc>
<signature>
<argument name="effect" type="String">
<desc>A string indicating which <a href="/category/effects/">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>
<desc>Apply the bounce effect to a div.</desc>
<css><![CDATA[
div {
width: 100px;
height: 100px;
background: #ccc;
border: 1px solid #000;
}
]]></css>
<html><![CDATA[
<p>Click anywhere to apply the effect.</p>
<div></div>
]]></html>
<code><![CDATA[
$( document ).click(function() {
$( "div" ).effect( "bounce", "slow" );
});
]]></code>
</example>
<category slug="methods"/>
<category slug="effects"/>
<category slug="effects-core"/>
</entry>