Following is the javascript that will change the images in a specific time
function startTime() {
var timerid = 0;
var images = new Array("CSS/Images/shy-baby.jpeg",
"CSS/Images/yao-ming.png",
"CSS/Images/success.jpg");
var countimages = 0;
if (timerid) {
timerid = 0;
}
var tDate = new Date();
if (countimages == images.length) {
countimages = 0;
}
if (tDate.getSeconds() % 5 == 0) {
document.getElementById("img1").src = images[countimages];
}
countimages++;
timerid = setTimeout("startTime()", 1000);
}
This is how I call it in my body tag:
<img class="headlineimage" id="img1" src="success.jpg" width="200" height="150" />
May I know that how should I insert hyperlinks to each images so that when I click on the specific image for example, success.jpg, it will direct me to www.success.com?
Appreciate your guides!