php_beginner_83 Posted January 1, 2010 Share Posted January 1, 2010 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. 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?? Quote Link to comment Share on other sites More sharing options...
php_beginner_83 Posted January 1, 2010 Author Share Posted January 1, 2010 I'm sorry I probably should of also said that I change the background image using javascript and the background image is specified using css. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.