Skip to content

Commit 95dcca4

Browse files
eironmanmgol
authored andcommitted
show: fix incorrect information related to !important
There was a contradiction between show() and css() documentation about !important behaviour. Closes #1015
1 parent ca8f052 commit 95dcca4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

entries/show.xml

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@
3232
<pre><code>
3333
$( ".target" ).show();
3434
</code></pre>
35-
<p>The matched elements will be revealed immediately, with no animation. This is roughly equivalent to calling <code>.css( "display", "block")</code>, except that the <code>display</code> property is restored to whatever it was initially. If an element has a <code>display</code> value of <code>inline</code>, then is hidden and shown, it will once again be displayed <code>inline</code>.</p>
36-
<p><strong>Note: </strong> If using !important in your styles, such as
37-
<code>display: none !important</code>,
38-
it is necessary to override the style using <code>.css( "display", "block !important")</code> should you wish for <code>.show()</code> to function correctly.</p>
35+
<p>The matched elements will be revealed immediately, with no animation. This is roughly equivalent to calling <code>.css( "display", "block" )</code>, except that the <code>display</code> property is restored to whatever it was initially. If an element has a <code>display</code> value of <code>inline</code>, then is hidden and shown, it will once again be displayed <code>inline</code>.</p>
36+
<p><strong>Note: </strong> If using !important in your styles, such as <code>display: none !important</code>, <code>.show()</code> will not override <code>!important</code>.
37+
It is recommended to use different classes with <code>.addClass()</code>, <code>.removeClass()</code> or <code>.toggleClass()</code>. Another approach is using <code>.attr( "style", "display: block !important;" )</code>; be careful, though, as it overwrites the style attribute of the element.</p>
3938
<p>When a duration, a plain object, or a "complete" function is provided, <code>.show()</code> becomes an animation method. The <code>.show()</code> method animates the width, height, and opacity of the matched elements simultaneously.</p>
4039
<p>Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings <code>'fast'</code> and <code>'slow'</code> can be supplied to indicate durations of <code>200</code> and <code>600</code> milliseconds, respectively.</p>
4140
<p>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 <code>swing</code>, and one that progresses at a constant pace, called <code>linear</code>. More easing functions are available with the use of plug-ins, most notably the <a href="http://jqueryui.com">jQuery UI suite</a>.</p>

0 commit comments

Comments
 (0)