onLoad for background image

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Csaba2000

    #1

    onLoad for background image

    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


  • hippo

    #2
    Re: onLoad for background image

    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="JavaS cript">
    <!--
    function setBackground() {
    document.body.s tyle.background Image='url(your image.jpg)';
    }
    //-->
    </SCRIPT>
    </head>
    <body onLoad="setBack ground()">
    your html
    </body>
    </html>


    Greetz,
    Hippo

    Comment

    Working...