Jen-
Aug 9th 2006, 3:48 pm
Hello, here is some image javascript I am using to show an image that I insert
and also a link to a different page when you click on the image.
I need to know how I would show a title for each image when the image is hovered over to add to this script. I think I need a new document.getElement, but I don't know how to incorporate it. Here is the script as it is now. Thank you very much!! Jen :)
arr=[
["image1.gif","page1.htm"],
["image2.gif","page2.htm"], // no comma at the end of last index
]
now=new Date()
nowDate=now.getDate()
function changeImg(){
if(nowDate>arr.length){
return
}
document.getElementById("img").src=arr[nowDate-1][0]
document.getElementById("link").href=arr[nowDate-1][1]
}
And this goes in the body section of the page...
<BODY onload="changeImg()">
<a href="#" id="link" target="_blank"><img border="0" id="img"></a>
and also a link to a different page when you click on the image.
I need to know how I would show a title for each image when the image is hovered over to add to this script. I think I need a new document.getElement, but I don't know how to incorporate it. Here is the script as it is now. Thank you very much!! Jen :)
arr=[
["image1.gif","page1.htm"],
["image2.gif","page2.htm"], // no comma at the end of last index
]
now=new Date()
nowDate=now.getDate()
function changeImg(){
if(nowDate>arr.length){
return
}
document.getElementById("img").src=arr[nowDate-1][0]
document.getElementById("link").href=arr[nowDate-1][1]
}
And this goes in the body section of the page...
<BODY onload="changeImg()">
<a href="#" id="link" target="_blank"><img border="0" id="img"></a>