javascript question

by "Phil Babcock" <pbabcock(at)bgsgroup.com>

 Date:  Wed, 03 May 2000 12:13:45 -0400
 To:  "hwg-languages(at)hwg.org" <hwg-languages(at)hwg.org>
  todo: View Thread, Original
HI all

I have a javascript function that preloads a bunch of images.  I have
another function that I want to execute only when all of these images are
fully downloaded.  How can I do this?

This is what I have:

function preload(){

image1 = new image();
image1.src = "test.gif";
//etc for a  whole lot of images

do_this_function_after_preload_has_completed();

return true;
}

However the second function is triggered right away, not after the images
are all loaded.  Does it not process the function one line at a time,
loading one image then the next then the next and finally doing the
"do_this_function_after_preload_has_completed();" function?


hope that makes sense

Phil Babcock
Lead Web Designer
BGS Group Inc.

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.