Otaqui.Com

Pete Otaqui’s blog about web development and everything else

Transparent IFrames in Internet Explorer using Javascript

one comment

In order to have an IFrame with a transparent background in Internet Explorer, you need to add an “allowtransparency” attribute, like so:

<iframe src="iframe_source.html" id="iframe_id" allowtransparency="true" />

However, if you want to set the transparency with Javascript via the DOM, you must camelCase the property:

document.getElementById('iframe_id').allowTransparency = true;

Note – you must also make sure that <body> tag in the document contained by the iframe is also transparent in order for the parent’s colours to show through.

Written by pete

June 10th, 2008 at 8:04 pm

Posted in Professional

Tagged with

One Response to 'Transparent IFrames in Internet Explorer using Javascript'

Subscribe to comments with RSS or TrackBack to 'Transparent IFrames in Internet Explorer using Javascript'.

  1. [...] Go to the author’s original blog: Transparent IFrames in Internet Explorer using Javascript [...]

Leave a Reply