fire a function when all image download complete
<p>i am downloading images in each iteration. so logic &amp; code is there in each iterator which download image one by one. i want that when all images download gets completed then immediately i want to call a function which notify user that all images download complete.
please guide me to modify my existing code.</p>

<p>here is my code</p>

<pre><code>$(document).ready(function () {
$("table[id*=dgImages] img").each(function () {
if($(this).offset().top &gt; $(window).scrollTop() &amp;&amp; $(this).offset().top &lt; $(window).scrollTop() + $(window).height()) {


$(this).attr("src", $(this).attr("original"));
$(this).removeAttr("original");
}
});
});
</code></pre>
