ALLOWTRANSPARENCY Attribute | allowTransparency参数属性
| DHTML文档教程 |
Sets or retrieves whether the object can be transparent.
dhtml语法
HTML | <ELEMENT ALLOWTRANSPARENCY
... >
|
---|
Scripting | object.allowTransparency(v) [ = bClear ] |
---|
DHTML可能的值
bClear | Boolean that
specifies or receives one of the following values.false | Default. Object is opaque. It cannot be transparent. | true | Object can be transparent. |
|
The property is read/write.
The property has a default value of
false.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see about dynamic properties.
remarks
when the property is set to false, the backgroundcolor property of the object can only be that of the window. when the property is set to true, the backgroundcolor property of the object can be set to any value, including the default value of transparent.
DHTML代码范例
The following example shows four ways to use the allowTransparency attribute, with and without the background-color attribute. because the allowtransparency attribute of frame1 is set to true, frame1 renders red, the background color of the parent document. the allowtransparency attribute of frame2 is also set to true, however the background-color attribute of frame2 is set to green, so frame2 renders green. because the allowtransparency attribute of frame3 is set to false (the default value), frame3 renders white, the color of the t:src document. the allowtransparency attribute of frame4 is also set to false, so frame4 renders white even though the background-color attribute of frame4 is set to green.
<body style="background-color: red">
<IFRAME ID="Frame1" SRC="transparentBody.htm" allowTransparency="true">
</IFRAME>
<IFRAME ID="Frame2" SRC="transparentBody.htm" allowTransparency="true"
STYLE="background-color: green">
</IFRAME>
<IFRAME ID="Frame3" SRC="transparentBody.htm">
</IFRAME>
<IFRAME ID="Frame4" SRC="transparentBody.htm"
STYLE="background-color: green">
</IFRAME>
</BODY>
This feature requires Microsoft® Internet Explorer 5.5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.
是否符合公共标准
This property is a Microsoft extension to
HTML .
Applies To