JavaScript Reference/Javascript Objects/defaults
Содержание
"defaults" CSS Attributes and JavaScript Style Properties
Names noted with an asterisk (*) are JavaScript properties only.
+----------------+--------------------------------------------------------------+
| CSS |accelerator background |
| Attributes |background-attachment background-color |
| and |background-image background-position |
| JavaScript |background-position-x background-position-y |
| Style |background-repeat behavior |
| Properties |border border-bottom |
| |border-bottom-color border-bottom-style |
| |border-bottom-width border-color |
| |border-left border-left-color |
| |border-left-style border-left-width |
| |border-right border-right-color |
| |border-right-style border-right-width |
| |border-style border-top |
| |border-top-color border-top-style |
| |border-top-width border-width |
| |color cursor |
| |direction display |
| |filter font |
| |font-family font-size |
| |font-style font-variant |
| |font-weight hasLayout(*) |
| |layout-grid layout-grid-char |
| |layout-grid-line layout-grid-mode |
| |layout-grid-type letter-spacing |
| |line-break line-height |
| |margin margin-bottom |
| |margin-left margin-right |
| |margin-top overflow |
| |overflow-x overflow-y |
| |padding padding-bottom |
| |padding-left padding-right |
| |padding-top page-break-after |
| |page-break-before pixelBottom(*) |
| |pixelHeight(*) pixelLeft(*) |
| |pixelRight(*) pixelTop(*) |
| |pixelWidth(*) posBottom(*) |
| |posHeight(*) posLeft(*) |
| |posRight(*) posTop(*) |
| |posWidth(*) scrollbar-3dlight-color |
| |scrollbar-arrow-color scrollbar-base-color |
| |scrollbar-darkshadow-color scrollbar-face-color |
| |scrollbar-highlight-color scrollbar-shadow-color |
| |scrollbar-track-color text-align |
| |text-align-last text-autospace |
| |text-decoration text-indent |
| |text-justify text-kashida-space |
| |text-overflow text-transform |
| |text-underline-position textDecorationBlink(*) |
| |textDecorationLineThrough(*) textDecorationNone(*) |
| |textDecorationOverline(*) textDecorationUnderline(*) |
| |unicode-bidi visibility |
| |white-space word-break |
| |word-spacing word-wrap |
| |zoom |
+----------------+--------------------------------------------------------------+
"defaults" Event Handlers
+----------------+--------------------------------------------------------------+
| Event |onBeforeEditFocus |
+----------------+--------------------------------------------------------------+
"defaults" Example
<html xmlns:yourNs>
<head>
<?import namespace="yourNs" implementation="yourHTC.htc"></head>
<body><div style= "color:red;
font-size:20pt;
font-Style:italic;
border:2px solid blue">
<br>Sample text in the main document<br>
<yourNs:yourTagName></yourNs:yourTagName>
</div>
</body>
</html>
<!--
Contents of yourHTC.htc:
-->
<public:component tagName="yourTagName">
<attach event="oncontentready" onevent=contentReady() />
</public:component>
<script language="JavaScript">
function contentReady(){
defaults.viewLink = document;
defaults.viewInheritStyle = false;
defaults.viewMasterTab = false;
}
function inheritStyle() {
boolInherit = defaults.viewInheritStyle;
defaults.viewInheritStyle = true;
}
</script>
<body>
<div id="extDiv"
style="font-size:20pt; font-weight:bold; border:3px solid green">
Imported Document Text
</div>
<br>
<button onclick="inheritStyle();">Set Inheritance to True</button>
</body>
"defaults" JavaScript Properties
+----------------+--------------------------------------------------------------+
| JavaScript |blockDirection canHaveHTML |
| Properties |contentEditable disabled |
| |isMultiline tabStop |
| |viewInheritStyle viewLink |
| |viewMasterTab vLink |
+----------------+--------------------------------------------------------------+
"defaults" Syntax and Note
Note:
Default properties of an element"s behavior.
To set default properties for an element, you must use an HTML component (HTC).
Syntax:
defaults.memberName