title: jQuery: Dynamic image handling (waiting for load)
body: <p>I'm trying to write a plugin that has a built in function to wait until all images that are on the page to be loaded before it executes itself. <code>$(window).load()</code> only works if it's the initial load of the page, but if someone wants to pull down some HTML through AJAX that contains images, it doesn't work.</p>
  
  <p>Is there any good way of doing this AND implementing it so that it can be self-contained in the plug-in? I've tried looping over <code>$('img').complete</code>, and I know that doesn't work (the images never load, and the browser crashes under a "script takes too long to complete" bug). For an example of what I'm trying to do, visit the page I'm looking to house the plugin at:</p>
  
  <p><a href="http://www.simplesli.de" rel="nofollow noreferrer">http://www.simplesli.de</a></p>
  
  <p>If you go to the "more uses" section (click it on the nav bar), you'll see that the image slideshow won't load properly. I know the current code doesn't work, but it's just holding place until I figure something out.</p>
  
  <p>Edit: Trying this solution, but it just doesn't work:</p>
  
  <pre><code>if($('.simpleSlide-slide img').size() &gt; 0) {
      var loaded_materials = $('.simpleSlide-slide img').get();
  } else {
      var loaded_materials = $('.simpleSlide-slide').get();
  }
  
  $(loaded_materials).live('load', function() {
           /* Image processing and loading code */
      });
  </code></pre>