-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Rule “do-you-avoid-using-inherit-value-of-style-display/rule”
- Loading branch information
1 parent
c2960cd
commit 0928d50
Showing
1 changed file
with
14 additions
and
12 deletions.
There are no files selected for viewing
26 changes: 14 additions & 12 deletions
26
rules/do-you-avoid-using-inherit-value-of-style-display/rule.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,33 @@ | ||
--- | ||
type: rule | ||
archivedreason: IE7 is no longer supported | ||
title: Do you avoid using "inherit" value of style.display? | ||
guid: a99dd941-f70a-4aa6-8526-fd2ee1b547c7 | ||
uri: do-you-avoid-using-inherit-value-of-style-display | ||
created: 2010-12-02T10:35:22.0000000Z | ||
authors: [] | ||
related: [] | ||
redirects: | ||
- do-you-avoid-using-"inherit"-value-of-style-display | ||
|
||
- do-you-avoid-using-"inherit"-value-of-style-display | ||
created: 2010-12-02T10:35:22.000Z | ||
archivedreason: IE7 is no longer supported | ||
guid: a99dd941-f70a-4aa6-8526-fd2ee1b547c7 | ||
--- | ||
The property value “inherit” of style.display is not recognized by IE7 and IE7 compatibility mode. So if you use this value in Javascript, it will cause script error in IE7 and IE7 compatibility like: "Message: Could not get the display property. Invalid argument." | ||
|
||
The property value “inherit” of style.display is not recognized by IE7 and IE7 compatibility mode. So if you use this value in Javascript, it will cause script error in IE7 and IE7 compatibility like: | ||
"Message: Could not get the display property. Invalid argument." | ||
So to make your Javascript and CSS style more compatible and avoid using "inherit" value of style.display: | ||
<!--endintro--> | ||
|
||
<!--endintro--> | ||
|
||
``` | ||
```js | ||
divLoading.style.display = "inherit"; | ||
``` | ||
|
||
Bad code - inherit property | ||
::: bad | ||
Bad code - inherit property. | ||
::: | ||
|
||
``` | ||
```js | ||
divLoading.style.display = "block"; | ||
``` | ||
|
||
Good code - block property | ||
::: good | ||
Good code - block property. | ||
::: |