show(): Fixed documentation#1015
Closed
eironman wants to merge 5 commits into
Closed
Conversation
There was a contradiction between show() and css() documentation about !important behaviour
AurelioDeRosa
requested changes
Jan 3, 2017
| 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> |
Member
There was a problem hiding this comment.
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" )
Member
There was a problem hiding this comment.
@AurelioDeRosa Your two code snippets differ not only in spacing. :-)
Member
|
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
Contributor
Author
|
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? |
Member
|
No worries, I'll rebase anyway. |
AurelioDeRosa
approved these changes
Jan 3, 2017
Member
|
I tweaked the text a little: the final sentence was a little misleading as using Landed, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a contradiction between show() and css() documentation about !important behaviour