Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add text to an image hyperlink javascript

Status
Not open for further replies.

SeeCharp

Programmer
Nov 15, 2006
12
US
Hello all I'm trying to use this same script and just add some text under the hyperlinked image I'll post the relevant code below. I know this can be done using arrays with some other code but this is the simple code I would like to use for this project. Any help would be appreciated.

<script type="text/javascript">
<!--
var image1=new Image()
image1.src="image1.txt="hello"

var image2=new Image()
image2.src="var image3=new Image()
image3.src="dontcare.jpg"
//-->
</script>

<script type="text/javascript">
<!--
//variable that will increment through the images
var step=1
//a variable that will keep track of the image currently being displayed.
var whichimage=1

function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.move1.src=eval("image"+step+".src")
whichimage=step
if (step<3)
step++
else
step=1
//call function "slideit()"
setTimeout("slideit()",4000)
}
slideit()
function slidelink(){
if (whichimage==1)
window.location="else if (whichimage==2)
window.location="link2.htm"
else if (whichimage==3)
window.location="link3.htm"
}

//-->
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top