By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,261 Members | 1,688 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,261 IT Pros & Developers. It's quick & easy.

onLoad for background image

P: n/a
With image elements I can do <IMG src="..." onLoad="..."> where
the onLoad is supposed to fire upon the image loading. Is there an
event that I can trap for once the background image in
<BODY background="...url..."> is loaded?
I plan to render a series of maps which sometimes take a while to
compute (on the server) so I'd like to know when subsequent ones
come in.

Failing that, can I assign an already loaded image to the background?
Thanks,
Csaba Gabor from Vienna
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

try this:
I have just posted a similar question, only my wish is to change it
due to the users screen resolution

<html>
<head>
<title>yourpage</title>
<SCRIPT language="JavaScript">
<!--
function setBackground() {
document.body.style.backgroundImage='url(yourimage .jpg)';
}
//-->
</SCRIPT>
</head>
<body onLoad="setBackground()">
your html
</body>
</html>
Greetz,
Hippo
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.