Code: Select all
jQuery.extend({
preload: {
images: function (imgURLs, callbacks)
{
var i = 0;
dummyImg = new Image();
dummyImg.src = imgURLs[i];
dummyImg.onLoad = function () {
alert('load executed');
(callbacks.onProgress) ? callbacks.onProgress(++i): "";
if (i != imgURLs.length)
{
this.src = imgURLs[i];
}
else
{
(callbacks.onComplete) ? callbacks.onComplete(): "";
}
}
}
}
});
I look at MDN and I couldn't find a Image() constructor function. Where's the Image objects and is there an onLoad handle?
Thanks for reading, I'd so much appreciate any help.