Skip navigation.

A Different World

We have just one world but we live in different ones.

iFrame allowtransparency Property

ALLOWTRANSPARENCY Attribute | allowTransparency Property

Sets or retrieves whether the object can be transparent.

Syntax
HTML<ELEMENT ALLOWTRANSPARENCY ... >
Scriptingobject.allowTransparency(v) [ = bClear ]

Possible Values
bClearBoolean that specifies or receives one of the following values.
falseDefault. Object is opaque. It cannot be transparent.
trueObject 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.

Example

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.

Standards Information

This property is a Microsoft extension to HTML.




You have to resolve 2 (two) things:

First, in the main page, where you have the <iframe> tag, add this simple attribute:

allowtransparency="true"

Example:

<iframe name="info" src="main.html" width="561" height="479" scrolling="auto" align="top" frameborder="0" marginwidth="0"
marginheight="0" allowtransparency="true">
// some code for browsers who are not able to view the <iframe> tag
</iframe>

Second, you have to put the transparency to the pages that should load into the <iframe>, with CSS like this:

<style type="text/css">

</style>

It really works, but not for Opera...

Opera Pathfinder - (Reloaded@2007-8-8)Keyboard Input Blocker

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.