I am pretty fluent in PHP and have very little knowledge of JavaScript LOL... I have a rotating image script that works fine, but i want to add custom text below each graphic, what do I need to add to the script below to do that? The text in red is what I "assume" I need to add but it doesn't work.
<script type="text/javascript">
<!--
//preload images
var image1=new Image()
image1.src="img1.jpg"
var image2=new Image()
image2.src="img2.jpg"
var image3=new Image()
image3.src="img3.jpg"
//-->
</script>
<script type="text/javascript">
<!--
var message=""
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
whichimage=step
if (step<3)
step++
else
step=1
setTimeout("slideit()",3000)
}
slideit()
function slidelink(){
if (whichimage==1)
window.location="link1.htm"
[COLOR="Red"]message="Image 1"[/COLOR]
else if (whichimage==2)
window.location="link2.htm"
[COLOR="Red"]message="Image 2"[/COLOR]
else if (whichimage==3)
window.location="link3.htm"
[COLOR="Red"]message="Image 3"[/COLOR]
}
//-->
</script>
HTML
<script type="text/javascript">
document.write(message)
</script>
Am I missing some markup like a semi-colon after the message=" " part that differentiates it from the URL declaration above it?