General Question

ETpro's avatar

Why Won't My Lightbox Light Up in IE?

Asked by ETpro (34428points) June 15th, 2011

Maybe it’s just that this lightbox has good taste in browsers.

I need another set of eyes to look at this and hopefully see what I must be looking right past. The site is and the problem is in IE only. Works fine in Firefox, Chrome, Opera. The little question mark icons by the options list of the ordering info box don’t work in IE. They should open a lightbox that provides a picture or test further explaining each option one appears beside. But in IE they just change the URL to or whatever number is clicked, but do not display. Any thoughts what’s wrong. IE isn’t giving any hint of a JavaScript error.

All the content in already on-page in DIVs with display set to none. The lightbox script just has to toggle the display to Block.

The scripts I am using are from By the way, the source page works OK in IE, so there is some subtle difference here that I am missing that’s killing it on my implementation of it.

Observing members: 0 Composing members: 0

15 Answers

XOIIO's avatar

What version of IE is it?

funkdaddy's avatar

The most common problem with IE and javascript that would cause it is a trailing comma when you define an array or object.

So for example (excuse formatting)

var js_obj = {
one: something,
two: something_else, <—- extra comma

the trailing comma after two will cause a problem in IE but not other browsers, which are less strict on this little bit of goofiness.

There’s quite a few scripts involved in the page and a lot seem to be condensed down to one line. Do you have a version you can run through quickly to check for those? I do it all the time when configuring a drop in piece like the lightbox.

Vortico's avatar

What @XOIIO said. If you’re talking about IE 6, don’t worry about it.

ETpro's avatar

@XOIIO I’m seeing the problem in IE 8, as is the client. I haven’t tested 7 but would bet it’s the same.

@funkdaddy I will look for that. Thanks. It’s a Yahoo! Store, and lots of the JavaScript there is theirs for tracking and statistics gathering, not mine. There stuff is out of my control. I just have to coexist with it, and that can be a challenge at times. They pop a buch of it in above the <HEAD> tag, which triggers quirks mode in IE sometimes.

@Vortico Yeah, I am now disregarding IE6. Anyone still using it deserves to see broken pages everywhere they go, because all the hacks it takes to make it act like a specs compliant browser are an evil far greater than a page that IE6 can’t render properly.

wenn's avatar

Well, its not really a “lightbox” because its just opening a new window, while a lightbox adds a container on top of the webpage itself to display the image.

Im going to take a stab and guess its the JS function in your href. IE probably get doesn’t get what to do because it’s not very good at life.

I would try using Fancybox, Lightbox 2, Shadowbox..i believe there are versions that work with the Prototype framework.

all you do is set up the little script and either use a class or rel attribute on the link, and href the large image and voila, as such:

<a href=“path/to/large/image.jpg” class=“lightbox” rel=“lightbox”>
<img src=“image/thumbnail.jpg alt=”” />

ETpro's avatar

@wenn Ah, Thanks. I really wanted the content in page and not written to a containing DIV by JavaScript. But maybe I can’t have that. Gah! I hate IE.

wenn's avatar

might i ask why you want images opening new windows?

funkdaddy's avatar

@ETpro – a couple things I noticed on a second pass

- one of the script tags isn’t closed, don’t know if you have control of that, but might cause unexpected behavior (line 47 I believe)
– there’s a lot of code in the lightbox script that detects IE and changes what it does, maybe disable that and give it a go to see if it pops up as expected but just isn’t formatted perfectly. Would let you know where the problem lies. If it helps, you know something is failing in the IE specific code rather than it being an issue with IE’s interpretation of the page as a whole.
Lightview seems to have better support, still uses prototype, and handles inline content so you could leave it in the page for other purposes. Might be a better fit if nothing else is working.

ETpro's avatar

@funkdaddy It has to be something else on the page or the coding I am feeding the script, because the sample page and site I downloaded it from both work fine in IE. See

Vortico's avatar

You could always go with another lightbox. There are literally hundreds around the internet.

ETpro's avatar

@Vortico That’s what I think I will do. Several people suggested Fancybox. I downloaded the files, and it looks great. Extremely flexible and powerful.

ETpro's avatar

Anybody here familiar with Fancybox and want to do a bit of troubleshooting? I think I have everything set up right, but it’s not working. Test page is at:

I’ll be happy to cover costs. PM me if interested.

funkdaddy's avatar

The fancybox script isn’t found currently.

Yahoo seems to have some sort of content delivery tool that has to be used?

This is the URL in the HTML

and I get a 404 there so the script isn’t loading.

I hope it helps.

ETpro's avatar

You’re kidding. A gremlin converted underscores into dashes. No wonder it isn’t wortking. Thanks for noticing that!

ETpro's avatar

@funkdaddy It was the error in the call to the JavaScript plus a handful of other interesting tidbits of punctuation and such that one wouldn’t run into without the script loading. Got it working. Thanks.

Answer this question




to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
Knowledge Networking @ Fluther