Forum Moderators: open

Message Too Old, No Replies

<body onload="blah"> not working in Mac IE 5.2, any suggestions?

body onload not working Mac IE 5.2

         

Tobasco

8:24 am on Aug 24, 2005 (gmt 0)

10+ Year Member



Hey Guys
Got a problem, which only occurs in IE Mac 5.2, with using the onload function in an HTML <BODY> tag, any suggestions how I might be able to get around it?

<html>
<head>
<title>random Masthead background</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" type="text/javascript">
//Edit this line to list all of your background images
var backgroundSrcs = new Array("images/header1.jpg","images/header2.jpg","images/header3.jpg","images/header4.jpg")
function pickimage()
{
//This line picks an image at random from the list you entered above
var bgimage=backgroundSrcs[(Math.round(Math.random()*(backgroundSrcs.length-1)))]
//This line applies the background image to your masthead
document.getElementById("masthead").style.backgroundImage = "url('" + bgimage + "')";
}
</script>
<style>
#masthead{
position:absolute;
top:0px;
left:0px;
width:100%;
height:104px;
border: 1px solid blue;
}
</style>
</head>
<body onload="pickimage()">
<div id="masthead">
<p>Your Masthead Goes Here</p>
</div>
</body>
</html>

jatar_k

5:14 pm on Aug 31, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well, IE for Mac was discontinued because it really was a piece of junk. I know this isn't an answer why but I wouldn't worry about it if you can help it.

Unfortunately anyone using it should be told to get a browser that works.

does the function just not get called or does it misbehave in some way?