can_add
11-22-2006, 11:23 AM
I'm making a web site and it has a header that is a ramdom image
Now i need to add alt tags to the images, how would i go about doing that?
I think alot of people has seen this code but here it is most of it
var theImages = new Array()
theImages[0] = 'images/head/head1.jpg" width="760" height="142'
theImages[1] = 'images/head/head2.jpg" width="760" height="142'
theImages[2] = 'images/head/head3.jpg" width="760" height="142'
theImages[3] = 'images/head/head4.jpg" width="760" height="142'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}
Now i need to add alt tags to the images, how would i go about doing that?
I think alot of people has seen this code but here it is most of it
var theImages = new Array()
theImages[0] = 'images/head/head1.jpg" width="760" height="142'
theImages[1] = 'images/head/head2.jpg" width="760" height="142'
theImages[2] = 'images/head/head3.jpg" width="760" height="142'
theImages[3] = 'images/head/head4.jpg" width="760" height="142'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}