fredy26
04-14-2003, 09:06 PM
If i have this in my head tag:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var theImages = new Array()
theImages[0] = '0.jpg'
theImages[1] = '1.jpg'
theImages[2] = '2.jpg'
theImages[3] = '3.jpg'
theImages[4] = '4.jpg'
theImages[5] = '5.jpg'
theImages[6] = '6.jpg'
theImages[7] = '7.jpg'
theImages[8] = '8.jpg'
theImages[9] = '9.jpg'
theImages[10] = '10.jpg'
theImages[11] = '11.jpg'
theImages[12] = '12.jpg'
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]+'">');
}
// End -->
</script>
and this in my body tag:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
showImage();
// End -->
</script>
How do i make the images smaller because they appear giant even if i use a table and make the table really small.
The code above is used by me to randomly generate images every time you refresh.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var theImages = new Array()
theImages[0] = '0.jpg'
theImages[1] = '1.jpg'
theImages[2] = '2.jpg'
theImages[3] = '3.jpg'
theImages[4] = '4.jpg'
theImages[5] = '5.jpg'
theImages[6] = '6.jpg'
theImages[7] = '7.jpg'
theImages[8] = '8.jpg'
theImages[9] = '9.jpg'
theImages[10] = '10.jpg'
theImages[11] = '11.jpg'
theImages[12] = '12.jpg'
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]+'">');
}
// End -->
</script>
and this in my body tag:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
showImage();
// End -->
</script>
How do i make the images smaller because they appear giant even if i use a table and make the table really small.
The code above is used by me to randomly generate images every time you refresh.