how to check a array of imgs is fully loaded
<p>i got the code here
a array like this var pics = ['1.jpg','2.jpg','3,jpg'];</p>

<p>loop throught the array</p>

<pre><code>var j = 0; 
var(var i in pics){ 
$(document.createElement(img)).attr('src',pics[i]).load(function(){
    alert(pics[i]+'is loaded');
    j++;
})}

if(j == pics.length){
alert('fully loaded');}
</code></pre>

<p>but all i got is 3,jpg is loaded all the time,
how to solve this? where am i wrong?</p>
