PDA

View Full Version : Resolved IE Flash layer conflict with lightbox



printman55
04-05-2010, 04:22 PM
1) Script Title: Lightbox image viewer 2.03a

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm

3) Describe problem: I getting a bug condition in Internet Explorer (fine in Firefox): I currently have a small flash movie running on the same page as
the lightbox viewer. The image comes up fine with all the effects, but when I click on the background or the X,the flash movie starts when it is not supposed to. Is there a work around for this? Thanks

jscheuer1
04-06-2010, 05:51 AM
Maybe. I'm not aware of anything in general about the lightbox script that would cause this though.

If you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

printman55
04-06-2010, 11:11 AM
Here is the site http://www.rspsitedesign.com/test.htm Open in Internet Explorer. Not a problem in Firefox.
Click on one of the light box icons. After the large image opens, either click the X close image or click the background and you will see the little Flash movie start on the retro TV screen. That Flash content is on a layer that only is supposed to start when you click on the Flash button to the left of the screen.
Thanks

jscheuer1
04-06-2010, 03:23 PM
That really shouldn't be happening. But it obviously is. I think this will fix it - Find this around line 731 in the lightbox.js file:


// ---------------------------------------------------

function showFlash(){
var flashObjects = document.getElementsByTagName("object");
for (i = 0; i != flashObjects.length; i++) {
flashObjects[i].style.visibility = "visible";
}

var flashEmbeds = document.getElementsByTagName("embeds");
for (i = 0; i != flashEmbeds.length; i++) {
flashEmbeds[i].style.visibility = "visible";
}
}

// ---------------------------------------------------

Using a text only editor like NotePad, change it to:


// ---------------------------------------------------

function showFlash(){
var flashObjects = document.getElementsByTagName("object");
for (i = 0; i != flashObjects.length; i++) {
flashObjects[i].style.visibility = "";
}

var flashEmbeds = document.getElementsByTagName("embeds");
for (i = 0; i != flashEmbeds.length; i++) {
flashEmbeds[i].style.visibility = "";
}
}

// ---------------------------------------------------

printman55
04-06-2010, 03:56 PM
John,
You're the best. Thanks so much for the code change. It now works in both browsers!
Steve

printman55
04-06-2010, 04:01 PM
One additional thing. Is there a way to add more html in addition to the link or caption? This script would make an awesome pop up.
Steve

jscheuer1
04-06-2010, 04:33 PM
I think there is. But the modifications and how one would go about it would get complex. There are already other lightbox type scripts out there that allow for more options, find one that suits your needs. One of the best is Lightwindow:

http://stickmanlabs.com/lightwindow/

Unfortunately their server is down and has been for a while.

Lightbox Gone Wild:

http://particletree.com/features/lightbox-gone-wild/

can import a page, so it could have just about anything on it you like.

You can Google each of these terms for other options:

lightbox

model window

lightbox clone

However, you can use the title attribute of the lightbox version you are using to cram in quite a lot of text, even use rich HTML. The only drawback is that when you hover over the link, you see all that stuff as a tooltip. But this can be avoided by setting the title attribute of the thumbnail image to something else.

If I was to update lightbox itself though, I'd use the most recent version (2.04 last I checked). I've already modified it for some things. Nothing like you are talking about here though. I have no current plans to do so.