-
Notifications
You must be signed in to change notification settings - Fork 264
show(): Fixed documentation #1015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a contradiction between show() and css() documentation about !important behaviour
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> | ||
<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> | ||
<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>. | ||
It is recommended to use different classes with <code>.addClass()</code>, <code>.removeClass()</code> or <code>.toggleClass()</code>. Another approach can be the use of <code>.attr("style","display:block !important")</code>, being careful not to overwrite the style attribute of the element.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi. The PR looks good. The only change required is to have the correct spacing here:
.attr("style","display:block !important")
It should be:
.css( "style", "display:block !important" )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AurelioDeRosa Your two code snippets differ not only in spacing. :-)
lol You're right. Wrong copy/paste. |
There was a contradiction between show() and css() documentation about !important behaviour
Update documentation to fit the standards
….jquery.com into eironman-patch-show
Ok, I fixed it, but I did a mess updating the commit comments with amend. Now there are 5 commits for this small change. Is it fine or should I start again? |
No worries, I'll rebase anyway. |
I tweaked the text a little: the final sentence was a little misleading as using Landed, thanks! |
There was a contradiction between show() and css() documentation about !important behaviour