andyc209
03-14-2004, 06:35 PM
I have used this script below but all I get is a white screen. the paths to the images are correct.
Can anyone help me please?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<SCRIPT LANGUAGE="Javascript"><!--
var arr = newArray("graphics/main_img1.jpg","graphics/main_img2.jpg","graphics/main_img3.jpg");
var increment = Math.floor(Math.random() * arr.length);
//pre-load image
var img = new Image();
img.src=arr[increment];
window.onload=function(){
document.getElementById('tblID').style.background="white url("+img.src+") no-repeat fixed center"
}
//--></SCRIPT>
<table id="tblID">
<tr>
<td width="500" height="500"></td>
</tr>
</table>
</body>
</html>
Can anyone help me please?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<SCRIPT LANGUAGE="Javascript"><!--
var arr = newArray("graphics/main_img1.jpg","graphics/main_img2.jpg","graphics/main_img3.jpg");
var increment = Math.floor(Math.random() * arr.length);
//pre-load image
var img = new Image();
img.src=arr[increment];
window.onload=function(){
document.getElementById('tblID').style.background="white url("+img.src+") no-repeat fixed center"
}
//--></SCRIPT>
<table id="tblID">
<tr>
<td width="500" height="500"></td>
</tr>
</table>
</body>
</html>