Hi All
I'm having a problem getting the background image of a <div> to stay. What I'm trying to do is when a user clicks on a thumbnail of an image a larger version of the thumbnail will be displayed on the same page. This works no problem. Depending on whether the image is landscape or portrait, I want to change the background image. It works but after a few seconds it goes back to the original background image. However, instead of having the link on an image(my thumbnails) when I put the code on text it works and the background sticks.
I change the background image using javascript and the background image is specified using css.
Does anyone have any idea what's going on or how I can solve this?? 😕
Thank you.
This is my php code with the link on the thumbnail....Using this the background image will change but then quickly go back to the original background image.
echo "<a href=\"".$_SERVER['SCRIPT_NAME']."?page=photo&img=".($dimarray[$i][1])."&ID=".$albumID."\"
onclick=\"changeBGImage()\">" . "<img src=\"" . $thumbDir . "/" . $paths[$i] . "\" alt=\"" . $paths[$i] . "\" />\n";
echo " </a>\n";
However, when I use this code the background image changes and stays...
echo '<a href="#" onclick="changeBGImage(\'background\')">shanna</a>';
Is there any other code you would need to see??