Feb 24, 2011

Delayed Image Preloading Using Mootools (preloader images)

There are possible scenarios that need image preloading. Most browsers only allow two concurrent requests at the same time to the same domain. When we do the image preloading on domready, it might hold up other resources that need to be loaded. Because we preload images that are not shown when the page loads, we can delay the preloading.

  1. Array.each.delay(3000,this,[
  2. ['foo.gif', 'bar.png','moo.png','tools.png', 'mootools.png'],
  3. function(src){var img = new Image();img.src = src;}
  4. ]);

No comments:

Post a Comment

Test post after a long time

i want to see the post