| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Nov 2006
Posts: 3
|
Image linking
I am very new to dreamweaver and am trying to set up a portfolio site. the question I have to ask is how do I make several thumbnails open up 1 at a time on the same page at a normal viewing size? Please Help. |
|
|
|
|
|
#2 (permalink) |
|
Spare Parts
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 5,145
|
Not sure I understand exactly what you mean? What about this? (for PHP version) Each img has two versions, 1small.jpg and 1big.jpg, 2small.jpg and 2big.jpg, etc. For tidyness put them in a folder called portfoliopics. On the thumbnail 1small.jpg make the link to displaybig.php?img=1big.jpg and for 2small.jpg make the link to displaybig.php?img=2big.jpg, etc. Create a page called displaybig.php (obviously call it what you like just adjust link accordingly) and in it include the script. <?php echo"<img src='portfoliopics/$img'>"; ?> <a href='javascript:history.back()'>Back</a> |
|
|
|
#3 (permalink) |
|
Spare Parts
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 5,145
|
How this works. By tagging ?img=1big.jpg on the end of the URl you are stting up a variable called img and giving it the value 1big.jpg. The PHP code on the displaybig.php page then uses the content of the variable <img src='portfoliopics/$img'> becomes <img src='portfoliopics/1big.jpg'>. If sending multiple vars to the next page the & sign is used before the additional vars. So for example if you wanted to send the width and height as well the link could read displaybig.php?img=1big.jpg&width=400&height=300 The PHP code could become <?php echo"<img src='portfoliopics/$img' width='$width' height='$height'>"; ?> |
|
|
|
#5 (permalink) |
|
Registered User
Join Date: Nov 2006
Posts: 3
|
Sorry for the confusion. Yes, I think that d3mcfadden has put it correctly. I want to simply have a few thumbnails on a a page and as you click on each one or scroll over them they would view in a main viewing are. Please could you tell me how to do this. Thanks for you patience. |
|
|
|
#6 (permalink) | |
|
Shitcasket™
|
Check out Lightbox JS Quote:
www.huddletogether.com/projects/lightbox/ |
|
|
![]() |