views:

30

answers:

2

Hi,

On my home page, I have four boxes, and when you click on them, javascript expands them (gradually), and when you click again, it makes it smaller.

The one thing I can't figure out is that in the top left hand corner there should be a closebox icon. This isn't displaying for me. I'm not an expert in javascript but I think this is the line of code that calls the image

    inImage2.setAttribute('src',zoomImagesURI+'closebox.png');

The closebox.png is currently in the images folder, and the zoomImagesURL is currently set to:

var zoomImagesURI   = '/images/';

I don't even mind if the closebox image isn't there, but in Firefox when you view the page, the outline is there where the image should be, just the image is not displayed. In internet explorer no image, or outline appears.

Any help would be appreciated, thanks!

A: 

Just a random thought here... Your 'images' folder is in the web root? As this would set the image src to "/images/closebox.png", maybe this should be in "images/closebox.png").

If that is the question, then you should only change the zoomImagesURI to 'images/';

zladuric
Also, can you open the closebox by opening http://yourdomain.com/images/closebox.png?
zladuric
Hi, yeah to be honest I've tried it that way, I've tried it a combination of ways and no matter what it just doesn't seem to want to display. It's a strange one :-S
TaraWalsh
A: 

try using an absolute location for your folder:

var zoomImagesURI   = 'http://www.mywebsite.com/images/';

also make sure that inImage2 is an image object.

console.log(inImage2.nodeName);
Q_the_dreadlocked_ninja