title: Fire an event after preloading images
body: <p>This is the code I use to preload images, I'm not sure if it's the best one.
  My question is, how can I fire and event, for an example alert(); dialog after is has finished loading all the images?</p>
  
  <pre><code>var preload = ["a.gif", "b.gif", "c.gif"];
      var images = [];
      for (i = 0; i &lt; preload.length; i++) {
          images[i] = new Image();
          images[i].src = preload[i];
      }
  </code></pre>