Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-19-2007, 03:34 AM   PM User | #1
flipper
New Coder

 
Join Date: Jan 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
flipper is an unknown quantity at this point
How to hyperlink target image in Set Image gallery?

I am using GoLive.

I have a series of thumbnail images that enlarge on the same page on rollover. How do I give each enlarged image its own hyperlink?

In the head is:

CSAct[/*CMP*/ 'c38dc8ed62'] = new Array(CSSetImageURL,/*CMP*/ 'credit',/*URL*/ '../../pagelements/dfphoto.jpg');

So then in the body "dfphoto.jpg" is linked to http://derekfowlesphotography.com:

td class="dsR136 dsR175"><a href="http://derekfowlesphotography.com" target="_blank"><img src="../../pagelements/dfphoto.jpg" alt="" name="credit" width="13" height="139" border="0" /></a></td>

That works, but then how do I assign different links to the other images when they are opened in the "credit" spot?



I have a feeling this is a common question, and have tried searches, but probably not using the right terms...
flipper is offline   Reply With Quote
Old 12-19-2007, 12:10 PM   PM User | #2
Actinia
Regular Coder

 
Actinia's Avatar
 
Join Date: Feb 2007
Location: Essex, UK
Posts: 250
Thanks: 1
Thanked 23 Times in 22 Posts
Actinia is on a distinguished road
You can have a container div (with id="credit", say) containing several divs each of which is hidden by default (display="none").

You then have a series of thumbnails each of which has an onclick that sets one of these target divs display property to "block".

Each of your divs would have a format such as:
Code:
<div class="switch" id="div1">
<a href="url1"><img src="image1.jpg" width = ... /></a>
</div
The style for class switch would be:
Code:
.switch { display: none;}
Each thumbnail would have the form:
Code:
<a href="#" onclick="showItem("div1");" ><img src="Thumb1.jpg" /></a>
The code for showItem would be:
Code:
function showItem() {
document.getElementByID.style.display="block";
return false;
}
You would also need some code to hide the display of any previous div, but that will depend on the context.

This code has not been tested.

John Rostron
Actinia is offline   Reply With Quote
Old 12-19-2007, 02:39 PM   PM User | #3
flipper
New Coder

 
Join Date: Jan 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
flipper is an unknown quantity at this point
Thank you so much.

Looks like you have dealt with this question before! I will try this out as soon as I can and will let you know how it goes. Thank you very much for taking the time to write such a thorough reply.
flipper is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:10 AM.


Advertisement
Log in to turn off these ads.