#1 (permalink)  
Old 01-24-2007, 09:48 PM
Registered User
 
Join Date: Jul 2004
Posts: 249
how to link slideshow images on js

I found and worked on a script which makes a slideshow out of my pictures. But I would like to add the proper links to every picture. Here's what I have:

Code:
<html>
<head>
	<title>Greg's Auctions</title>
<script language="JavaScript">
<!-- 
var interval = 1500; 
var random_display = 0;
var image_dir = ""
var ImageNum = 0;
imageArray = new Array();

imageArray[ImageNum++] = new imageItem(image_dir + "http://i.domaindlx.com/wheelofgod/transformers/constructicons.jpg");
imageArray[ImageNum++] = new imageItem(image_dir + "http://i.domaindlx.com/wheelofgod/transformers/decepticonbeasts.jpg");
imageArray[ImageNum++] = new imageItem(image_dir + "http://i.domaindlx.com/wheelofgod/transformers/decepticontargetmasters.jpg");
imageArray[ImageNum++] = new imageItem(image_dir + "http://i.domaindlx.com/wheelofgod/transformers/optimusrodimustrailers.jpg");
imageArray[ImageNum++] = new imageItem(image_dir + "http://i.domaindlx.com/wheelofgod/transformers/ultramagnus.jpg");

var number_of_image = imageArray.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}
function randNum(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
if (random_display) {
ImageNum = randNum(0, number_of_image-1);
}
else {
ImageNum = (ImageNum+1) % number_of_image;
}
var new_image = get_ImageItemLocation(imageArray[ImageNum]);
return(new_image);
}

function getPrevImage() {
ImageNum = (ImageNum-1) % number_of_image;
var new_image = get_ImageItemLocation(imageArray[ImageNum]);
return(new_image);
}

function prevImage(place) {
var new_image = getPrevImage();
document[place].src = new_image;
}

function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
timerID = setTimeout(recur_call, interval);
}


//   -->
</script>
</head>
<body bgcolor="#ffffff" onLoad="rotateImage('rImage')">
<center>
<table border=0 cellpadding=4 cellspacing=0>
<tr>
	<td class="td" align=center><font face="verdana, helvetica" size=1><b>Take a look at my other auctions</b>
	<p><a href="#" onClick="rotateImage('rImage')">> play slideshow</a>&nbsp;&nbsp;<a href="#" onClick="clearTimeout(timerID)">|| pause slideshow</a><br>

	<a href="#" onClick="prevImage('rImage'); clearTimeout(timerID)"><< previous</a>&nbsp;&nbsp;<a href="#" onClick="rotateImage('rImage'); clearTimeout(timerID)">next >></a><br></font></td>
</tr>
<tr>
	<td class="td" align=center><img name="rImage" src="27.jpg" width=500 height=375 border=1>
	<p><a href="http://i.domaindlx.com/wheelofgod"><font face="verdana, helvetica" size=1>http://i.domaindlx.com/wheelofgod</font></a></td>
</tr>
</table>
</center>
</body>

</html>
Reply With Quote

Reply


Thread Tools
Display Modes 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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rolling over a different series of images? cprescott1972 Programming and Scripting 1 09-16-2006 10:24 PM
Link to load next page tnewbery Programming and Scripting 1 09-08-2006 10:50 AM
Jump to a sub Function from a link???? NevadaSam Programming and Scripting 2 05-08-2006 11:37 AM
Trying to combine Slideshow javascript and transparent PNG files moez Programming and Scripting 0 01-23-2006 10:38 AM
multiple o/ps using link swapnil Programming and Scripting 0 07-27-2005 04:40 AM


All times are GMT -5. The time now is 05:22 PM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter