i got a code which can be used to notify user when all images download complete but the flow of the code is not very clear to me. can anyone explain please in detail.
what one() function and what it does...how load() function is calling
here is the code
$("#loadingDiv").show();
var nImages = $("#all-images").length;
var loadCounter = 0;
$("#all-images img").one("load", function() {
loadCounter++;
if(nImages == loadCounter) {
$(this).parent().show();
$("#loadingDiv").hide();
}
}).each(function() {
// attempt to defeat cases where load event does not fire
// on cached images
if(this.complete) $(this).trigger("load");
});
thanks