PDA

View Full Version : Coding question


oswegan
03-17-2008, 07:18 PM
I wanted to add a feature to my photobox that would allow the user to click the current photo and have a link take them to the previous photo. Simple right?

So I changed the code from this:


<div id="photobox" style="width:<IMAGE_WIDTH>px;position:relative;">
<div id="image-border" style="width: <IMAGE_WIDTH>px; height: <IMAGE_HEIGHT>px;">
<img src="images/<IMAGE_NAME>" width="<IMAGE_WIDTH>" height="<IMAGE_HEIGHT>" id="photo" name="photo" />

To this:


<div id="photobox" style="width:<IMAGE_WIDTH>px;position:relative;">
<div id="image-border" style="width: <IMAGE_WIDTH>px; height: <IMAGE_HEIGHT>px;">
<a href="index.php?showimage=<IMAGE_PREVIOUS_ID>"><img src="images/<IMAGE_NAME>" width="<IMAGE_WIDTH>" height="<IMAGE_HEIGHT>" id="photo" name="photo" /></a>


It works perfectly on Internet Explorer 7, but has absolutely no effect in Firefox. I haven't tested Safari yet.

Any idea why???

fredxeric
03-17-2008, 08:43 PM
./index.php

oswegan
03-17-2008, 09:15 PM
No effect.

dakwegmo
03-17-2008, 10:46 PM
My guess is that it has to do with the image fade in script. Since the image id 'photo' is initially set to invisible, the script may not accurately make the image 100% visible, thus not clickable. Try removing the id="photo" from your img tag and see if activates the image as a link. If so you'll probably have to figure out a work around for the fade in script.

oswegan
03-18-2008, 12:27 AM
Why do you suppose that would only affect Firefox?

dakwegmo
03-18-2008, 12:42 AM
It could be the way the script is written, or it could just be the way the different browsers interpret standards.