Need explanation for the jquery code
<p>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.</p>

<p>what one() function and what it does...how load() function is calling</p>

<p>here is the code</p>

<pre><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");
});
</code></pre>

<p>thanks</p>
