out of nowhere
Posts: 20
Joined: Tue Mar 11, 2008 11:48 pm

Another iframe transparency issue - with IE

Hello

I know there are other topics on this but I have used the suggested CSS rules and I still can not achieve a transparent background to my iframe content in Internet Explorer (7 & 8 tested) although all is fine in Firefox and Safari.

I have set up a simple test page to illustrate using the standard HS iframe example. In the example CSS I have set

.highslide-wrapper, .highslide-outline {
background: none;
}
.highslide-html {
background-color: transparent;
}

In the iframe.html file I have the outline to null and given the page a background colour.

In the include-short.html file I have set

body { background-color: transparent; background: none; }

Otherwise all else is unchanged from the original HS example. it's up at http://www.outofnowhere.co.uk/hs-test/e ... frame.html

It seems that the HS window is transparent but the iframe content background stays white no matter what I try. I've been battling this all day and would really appreciate any help, thanks
User avatar
RoadRash
Posts: 8249
Joined: Tue Jul 15, 2008 6:43 pm
Location: Fredrikstad, Norway
Contact: Website

Re: Another iframe transparency issue - with IE

To make this work with iframes in IE you need to add allowtransparency="true" inside the highslide js file (highslide-with-html.js or highslide-full.js).
Searh for this line:

Code: Select all

this.body.innerHTML += '<iframe name="hs'+ (new Date()).getTime() +'" frameborder="0" key="'+ this.key +'" '
And change it to:

Code: Select all

this.body.innerHTML += '<iframe name="hs'+ (new Date()).getTime() +'" frameborder="0" allowtransparency="true" key="'+ this.key +'" '
Hilde
Highslide Support Team

Overview of my Highslide sample pages: RoadRash.no
out of nowhere
Posts: 20
Joined: Tue Mar 11, 2008 11:48 pm

Re: Another iframe transparency issue - with IE

Thank you so much, I really appreciate your very quick reply, that works perfectly
torstein.honsi
Site Admin
Posts: 9215
Joined: Thu Nov 09, 2006 11:22 am
Location: Vik i Sogn, Norway

Re: Another iframe transparency issue - with IE

Before IE8, the allowtransparency used to be "true" by default. Then we discovered that links were clickable through the iframe expanders in IE8, and this was fixed by setting allowtransparency to "false". Just so that you know the consequence of setting it to "true".
Torstein Hønsi
CTO, Founder
Highsoft
asidorov72
Posts: 1
Joined: Thu Sep 20, 2012 7:57 am

Re: Another iframe transparency issue - with IE

Hello.
1. How can I set unique attributes to the iframe tag such like "id" for example?
I would like to use several modal windows with iframe, but I need they have unique ids.

2. Can you help me how I can use css file for the iframe content?

I tried to include it as usual, but it doesn't work:

Code: Select all

<script type="text/javascript" src="js/highslide/highslide-full.js"></script>
<link rel="stylesheet" type="text/css" href="js/highslide/highslide.css" />
<link rel="stylesheet" type="text/css" href="css/highslide-modal.css" />
Thank you very much!
User avatar
RoadRash
Posts: 8249
Joined: Tue Jul 15, 2008 6:43 pm
Location: Fredrikstad, Norway
Contact: Website

Re: Another iframe transparency issue - with IE

Hi,

1. You canÔÇÖt set unique id for each iframe tag inside the Highslide iframe popup since the code that creates all iframes are the same.

2. You need to add the CSS file to the head of the page that you open inside the Highslide iframe popup, not to the head of the main page.
Hilde
Highslide Support Team

Overview of my Highslide sample pages: RoadRash.no

Return to “Highslide JS Usage”