This is a continuation of my previous post, preloading images with jQuery.
More info about preloaders: here.

This articles is for those who wish to use preloaders but do not use jQuery.

function preload(images)
    for (var i = 0; i < images.length; i++)
         var img_path = images[i];
         var img_obj = new Image();
         img_obj.src = img_path;


preload(["1.jpg", "2.jpg", "icons/icon.png"]);

This function will take as parameter an array with all the images and preload them. The paths of the images can be relative or absolute.