Project

General

Profile

1

    
2
<ul class="UIAPIPlugin-toc">
3
<li><a href="#overview">Overview</a></li>
4
<li><a href="#options">Arguments</a></li>
5
</ul>
6
<div class="UIAPIPlugin">
7
  <h1>jQuery UI hide</h1>
8
  <div id="overview">
9
    <h2 class="top-header">Overview</h2>
10
    <div id="overview-main">
11
        <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/UI/Effects/hide?section=1" title="Edit section: hide( effect, [options], [speed], [callback] )">edit</a>]</div><a name="hide.28_effect.2C_.5Boptions.5D.2C_.5Bspeed.5D.2C_.5Bcallback.5D_.29"></a><h3>hide( effect, <span class="optional">[</span>options<span class="optional">]</span>, <span class="optional">[</span>speed<span class="optional">]</span>, <span class="optional">[</span>callback<span class="optional">]</span> )</h3>
12
<p>The enhanced hide method optionally accepts jQuery UI advanced effects.</p>
13
<p>Uses a specific effect on an element to hide the element if the first argument is an effect string.</p>
14
    </div>
15
    <div id="overview-dependencies">
16
        <h3>Dependencies</h3>
17
        <ul>
18
<li>Effects Core</li>
19
</ul>
20
    </div>
21
    <div id="overview-example">
22
        <h3>Example</h3>
23
        <div id="overview-example" class="example">
24
<ul><li><a href="#demo"><span>Demo</span></a></li><li><a href="#source"><span>View Source</span></a></li></ul>
25
<p><div id="demo" class="tabs-container" rel="170">
26
Apply the effect slide if you click on the p to hide a div.<br />
27
</p>
28
<pre>$(&quot;p&quot;).<a href="http://docs.jquery.com/Events/click" title="Events/click">click</a>(function () {
29
      $(&quot;div&quot;).<strong class="selflink">hide</strong>(&quot;slide&quot;, {}, 1000);
30
    });
31
</pre>
32
<p></div><div id="source" class="tabs-container">
33
</p>
34
<pre>&lt;!DOCTYPE html&gt;
35
&lt;html&gt;
36
&lt;head&gt;
37
  &lt;link href=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;/&gt;
38
  &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js&quot;&gt;&lt;/script&gt;
39
  &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js&quot;&gt;&lt;/script&gt;
40
  &lt;script src=&quot;http://ui.jquery.com/latest/ui/effects.core.js&quot;&gt;&lt;/script&gt;
41
&lt;script src=&quot;http://ui.jquery.com/latest/ui/effects.slide.js&quot;&gt;&lt;/script&gt;
42
&lt;style type=&quot;text/css&quot;&gt;
43
  div { margin: 0px; width: 100px; height: 80px; background: blue; position: relative; }
44
&lt;/style&gt;
45
  &lt;script&gt;
46
  $(document).ready(function() {
47
    $(&quot;p&quot;).<a href="http://docs.jquery.com/Events/click" title="Events/click">click</a>(function () {
48
      $(&quot;div&quot;).<strong class="selflink">hide</strong>(&quot;slide&quot;, {}, 1000);
49
    });
50
  });
51
  &lt;/script&gt;
52
&lt;/head&gt;
53
&lt;body style="font-size:62.5%;"&gt;
54
  
55
&lt;p&gt;Click me&lt;/p&gt;&lt;div&gt;&lt;/div&gt;
56

    
57
&lt;/body&gt;
58
&lt;/html&gt;
59
</pre>
60
<p></div>
61
</p><p></div>
62
    </div>
63
  </div>
64
  <div id="options">
65
    <h2 class="top-header">Arguments</h2>
66
    <ul class="options-list">
67
      
68
<li class="option" id="option-effect">
69
  <div class="option-header">
70
    <h3 class="option-name"><a href="#option-effect">effect</a></h3>
71
    <dl>
72
      <dt class="option-type-label">Type:</dt>
73
        <dd class="option-type">String</dd>
74
      
75
    </dl>
76
  </div>
77
  <div class="option-description">
78
    <p>The effect to be used. Possible values: 'blind', 'clip', 'drop', 'explode', 'fold', 'puff', 'slide', 'scale', 'size', 'pulsate'.</p>
79
  </div>
80
</li>
81

    
82

    
83
<li class="option" id="option-options">
84
  <div class="option-header">
85
    <h3 class="option-name"><a href="#option-options">options</a></h3>
86
    <dl>
87
      <dt class="option-type-label">Type:</dt>
88
        <dd class="option-type">Hash</dd>
89
      
90
      <dt class="option-optional-label">Optional</dt>
91
      
92
    </dl>
93
  </div>
94
  <div class="option-description">
95
    <p>A object/hash including specific options for the effect.</p>
96
  </div>
97
</li>
98

    
99

    
100
<li class="option" id="option-speed">
101
  <div class="option-header">
102
    <h3 class="option-name"><a href="#option-speed">speed</a></h3>
103
    <dl>
104
      <dt class="option-type-label">Type:</dt>
105
        <dd class="option-type">String, Number</dd>
106
      
107
      <dt class="option-optional-label">Optional</dt>
108
      
109
    </dl>
110
  </div>
111
  <div class="option-description">
112
    <p>A string representing one of the predefined speeds ("slow" or "fast") or the number of milliseconds to run the animation (e.g. 1000).</p>
113
  </div>
114
</li>
115

    
116

    
117
<li class="option" id="option-callback">
118
  <div class="option-header">
119
    <h3 class="option-name"><a href="#option-callback">callback</a></h3>
120
    <dl>
121
      <dt class="option-type-label">Type:</dt>
122
        <dd class="option-type">Function</dd>
123
      
124
      <dt class="option-optional-label">Optional</dt>
125
      
126
    </dl>
127
  </div>
128
  <div class="option-description">
129
    <p>A function that is called after the effect is completed.</p>
130
  </div>
131
</li>
132

    
133
    </ul>
134
  </div>
135
</div>
136

    
137
</p><!-- 
138
Pre-expand include size: 6354 bytes
139
Post-expand include size: 8727 bytes
140
Template argument size: 5453 bytes
141
Maximum: 2097152 bytes
142
-->
143

    
144
<!-- Saved in parser cache with key jqdocs_docs:pcache:idhash:2614-1!1!0!!en!2 and timestamp 20101025041050 -->
(11-11/23)