PDA

View Full Version : How do you link images to url?



doogietim02
12-12-2010, 04:55 PM
1) Script Title: Conveyor Belt slideshow script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/leftrightslide.htm

3) Describe problem: How do you link one of the images to a url?

Schmoopy
12-12-2010, 05:54 PM
Taking the code posted on this script's page as an example:



//Specify the slider's width (in pixels)
var sliderwidth="300px"
//Specify the slider's height
var sliderheight="150px"
//Specify the slider's slide speed (larger is faster 1-10)
var slidespeed=3
//configure background color:
slidebgcolor="#EAEAEA"

//Specify the slider's images
var leftrightslide=new Array()
var finalslide=''
leftrightslide[0]='<a href="http://"><img src="http://www.dynamicdrive.com/dynamicindex4/dynamicbook1.gif" border=1></a>'
leftrightslide[1]='<a href="http://"><img src="http://www.dynamicdrive.com/dynamicindex4/dynamicbook2.gif" border=1></a>'
leftrightslide[2]='<a href="http://"><img src="http://www.dynamicdrive.com/dynamicindex4/dynamicbook3.gif" border=1></a>'
leftrightslide[3]='<a href="http://"><img src="http://www.dynamicdrive.com/dynamicindex4/dynamicbook4.gif" border=1></a>'
leftrightslide[4]='<a href="http://"><img src="http://www.dynamicdrive.com/dynamicindex4/dynamicbook5.gif" border=1></a>'

//Specify gap between each image (use HTML):
var imagegap=" "

//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=5


Edit where it has <a href="http://"> to whatever URL you want, for example:



leftrightslide[0]='<a href="http://google.com"><img src="http://www.dynamicdrive.com/dynamicindex4/dynamicbook1.gif" border=1></a>'
leftrightslide[1]='<a href="http://amazon.com"><img src="http://www.dynamicdrive.com/dynamicindex4/dynamicbook2.gif" border=1></a>'
leftrightslide[2]='<a href="http://mysite.com"><img src="http://www.dynamicdrive.com/dynamicindex4/dynamicbook3.gif" border=1></a>'
leftrightslide[3]='<a href="http://example.com"><img src="http://www.dynamicdrive.com/dynamicindex4/dynamicbook4.gif" border=1></a>'
leftrightslide[4]='<a href="http://dynamicdrive.com"><img src="http://www.dynamicdrive.com/dynamicindex4/dynamicbook5.gif" border=1></a>'