erikbeam Posted May 27, 2008 Share Posted May 27, 2008 I hope I don't get too long-winded describing this. I've got the typical photo gallery. Using iframes, I've got menu on the left, the big image in the center, and a table of thumbnails on the right. The center iframe is .../bigpic1.php. Each thumbnail, when clicked will open .../bigpic1.php?thumb=1 or ...?thumb=2, etc... In /bigpic1.php, I'm using the trick where the image is the background and there's a transparent .gif file directly over it, so the callout for the actual image is in the style sheet: { background-image:url('<?php $thumbnum = $_GET['thumb']; echo $thumbnum; ?>.jpg') background-repeat: no-repeat; background-attachment: fixed; background-position: center; } Everything works perfectly as you click down the thumbnails, except the original background image never changes. When I view source on the center frame I see: { background-image:url('3.jpg') background-repeat: no-repeat; background-attachment: fixed; background-position: center; } Or whichever number thumbnail was clicked, the code is working, but I still see 1.jpg as the image. I thought it might have something to do with the iframes, so I right-clicked "Open in new window" and it's the same effect. I've verified that all the 1.jpg, 2.jpg, 3.jpg, etc... images are where they need to be, and even opened them manually .../1.jpg to see them. Is this something to do with refreshing the background? If I just hit refresh it does nothing, nor does Ctrl+F5. Any ideas? Link to comment https://forums.phpfreaks.com/topic/107369-weird-behavior-of-my-pages/ Share on other sites More sharing options...
jonsjava Posted May 27, 2008 Share Posted May 27, 2008 sounds like some sort of browser caching issue. I don't know past that. Link to comment https://forums.phpfreaks.com/topic/107369-weird-behavior-of-my-pages/#findComment-550543 Share on other sites More sharing options...
Smackie Posted May 27, 2008 Share Posted May 27, 2008 is the images in a folder? if so your going to need to do this.. (example folder images) { background-image:url('<?php $thumbnum = $_GET['thumb']; echo 'images/'.thumbnum.'; ?>.jpg') background-repeat: no-repeat; background-attachment: fixed; background-position: center; } just taking a guess problem lol not sure if it will work. Link to comment https://forums.phpfreaks.com/topic/107369-weird-behavior-of-my-pages/#findComment-550554 Share on other sites More sharing options...
erikbeam Posted May 27, 2008 Author Share Posted May 27, 2008 I've tried loading the page then going through Tools->Options->Delete All Files and the same old photo shows up. And the images are all in the same directory as the rest of the files. I had the page working using the exact code that shows up through View Source. I would like this to be one dynamic file though, rather than having a bigpicxxx.php file for each thumbnail on the list (for the whole site that could be thousands). I'm used to code giving my the death message when something crashes. This one's doing what it's supposed to (changing the x.jpg name) and still leaves me in the wrong. I'll keep plugging away at it, though. Thanks for the ideas. Link to comment https://forums.phpfreaks.com/topic/107369-weird-behavior-of-my-pages/#findComment-550561 Share on other sites More sharing options...
haku Posted May 27, 2008 Share Posted May 27, 2008 Take the single quotes off the url in the stylesheet and see what happens. I don't use quotes around my urls when linking to background images in CSS, but I don't know if they are optional, or if you are not allowed to use them. If they are optional, then taking them away won't matter, as I know for a fact it will work without the quotes. But if you are not allowed to have them, that could be what is causing your problems. Link to comment https://forums.phpfreaks.com/topic/107369-weird-behavior-of-my-pages/#findComment-550618 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.