Forum Moderators: coopster

Message Too Old, No Replies

Displaying images

in same box.

         

adamnichols45

4:04 pm on Apr 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a page with 6 images - on the right I have them displayed as 6 thumbnails.

Rather than have them open in a popup window I would like them to all show up in a MAIN left box when clicked.

Hows the best way to go about this guys. Also the thumbnails are the same size but the main images will be slightly different sizes.

ahmedtheking

4:26 pm on Apr 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok the best way to do it is to pass vars in the URL as a GET var. So each thumbnail links to /file.php?show=thispic.jpg

Your PHP code is then

<? // get the image size
list($width, $height, $type, $attr) = getimagesize($_GET['show']);
?>
<img src="<?=$_GET['show'];?>" width="<?=$width;?>" height="<?=$height;?>" />

And that's pretty much it!

whoisgregg

7:21 pm on Apr 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is a problem typically solved with javascript [webmasterworld.com] to avoid unnecessary page reloads and duplicate content issues with search engines.

Try searches at the search engine of your choice for 'javascript rollover', 'javascript photo gallery', or 'javascript lightbox' for some examples and ideas.

adamnichols45

11:34 am on Apr 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Im aware of the Php method posted above thanks for that.

My ony problem with that method is that the page re-loads and I dont want to have to have the page re-load.

I was not aware that I could be penalised by going down that route though!

I am looking into the javascript option im just worried about those that have javascript turned off!

Thanks guys.