Results 1 to 3 of 3

Thread: body onLoad

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    North Yorkshire
    Posts
    102

    body onLoad

    Hi,
    I've got a problem with a page that has some rollover images that are pre-loaded. I load both the default image and the rollover images into variables / objects (whatever) in a function called init()
    Now, on my page,

    <body onload=init();>

    to fire off the init routine.

    If however, you leave your mouse over the image or quickly move it to another one before the whole page has loaded up, I get a javascript error saying that the object is not loaded.

    Is there a standard way to get around this problem ?

    ta

    Andy

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    first of all, don't preload it with a function,

    just preload then in the fist line of your page,!!


    the onLoad event fire when all images on a page are finish loaded!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    North Yorkshire
    Posts
    102
    Hi,
    thanks for the reply. I think I actually need to do a couple of calls, one to load the initial images and the second fired by onLoad to set the defaults for the images once they're loaded. Makes sense to me anyhow !

    thanks for your help

    cheers
    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width