...

View Full Version : Code working in FF2 but nothing else!



daved2424
06-20-2008, 06:20 PM
I have some code that works fine in FF2, but for some reason it doesn't work in FF3, IE6 and Safari.

To see see the problem click on the link below then click on any marker on the map. Then click on a preview image to see a larger version. This much appears to work in all browsers, but when you close the image and open another one something goes wrong.

The image is located within a div with another div inside it. This nested div starts off with a height of 10000px to allow the image to load of screen and then be resized before the nested div is then shrunk to show the image. Line 524:


document.getElementById('imageSpacer').style.height=(((myHeight-120) - (img_height)) / 2 + 'px');

Then after this the close button fails to work altogether. In addition to this the forwards and backwards buttons (currently not styled) do not work in anything other then FF2.

I have tried trawling through my code trying to find out where it is going wrong but to no avail. I hope I have explained this clearly enough and I would be very grateful if anyone can help!

http://holidaymaps.googlepages.com/IMAGEtest.html

NancyJ
06-21-2008, 10:12 AM
My console reports that document.getElementById('pictureRight') is null - on this line: document.getElementById('pictureRight').style.display="none"; and an unterminated string literal with your javascript:loadImage()

I don't know if that helps.

Kor
06-21-2008, 05:55 PM
Your page does not pass the W3C validation either:
http://validator.w3.org/check?uri=http%3A%2F%2Fholidaymaps.googlepages.com%2FIMAGEtest.html&charset=%28detect+automatically%29&doctype=Inline&group=0

daved2424
06-22-2008, 12:41 PM
I have now validated my XHTML and passes fine now.

I removed the offending Javascript that you mentioned above but that does not appear to be what is causing the problem. What were you using to discover that error anyway? I have tried using the error console in FF and Firebug but can't see a feature that would give me that kind of error.

daved2424
06-22-2008, 04:54 PM
After I threatened my code it finally responded. Well, not quite. The problem Appears to be the drawing and re-drawing of overlaying DIVs, it just didn't like it. So each time the DIVs now have a number in their name which increments each time they are drawn again resulting in two DIVs never having the same name. Not quite strictly how it should probably work, but it does the trick none the less.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum