Old 26-11-2006, 11:09   #1 (permalink)
TonyF
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.
  Reply With Quote
Old 26-11-2006, 12:28   #2 (permalink)
datahound
Spare Parts
 
datahound's Avatar
 
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>
__________________
  Reply With Quote
Old 26-11-2006, 12:35   #3 (permalink)
datahound
Spare Parts
 
datahound's Avatar
 
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'>";
?>
__________________
  Reply With Quote
Old 26-11-2006, 13:21   #4 (permalink)
d3mcfadden
Senior Member
 
d3mcfadden's Avatar
 
Join Date: Apr 2005
Location: -
Posts: 694
Send a message via AIM to d3mcfadden
I think he wants a javascript to swap the big images in a container when thumbnails are rolled over..
  Reply With Quote
Old 27-11-2006, 16:21   #5 (permalink)
TonyF
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.
  Reply With Quote
Old 27-11-2006, 19:37   #6 (permalink)
sub
Shitcasket™
 
sub's Avatar
 
Join Date: Jul 2005
Location: Brighton
Posts: 4,862
Send a message via MSN to sub Send a message via Skype™ to sub
Check out Lightbox JS
Quote:
Lightbox JS is a simple, unobtrusive script used to overlay images on the current page. It's a snap to setup and works on all modern browsers.

www.huddletogether.com/projects/lightbox/
__________________
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8