recursive jquery function and check afterwards
<p>I deploy two functions on my gallery page. One to display -one by one- the list items with images, and two to check and remove those items where the images (external) won't load. </p>

<p>The first one works excellent, but the second does not. Can't figure out why. Does anyone knows this one?</p>

<pre><code>var r = 0,
    selector = "ul.display li:hidden:first";

function fadeIn($item) {
    $item.fadeIn(200, function() {
        var n = $(selector);
        if (n.length &gt; 0) {
            fadeIn($(selector));
        } else {
            // add a div
            $(".navigate").show("fast");
            $("#downunder").show("slow");
        }
    })
}


fadeIn($(selector));
function myFunc() {
    $("ul.display li img").each(function(index) {
        if ((!this.width || !this.height)) {
            pos3 = $(this).attr("id");
            reportrefcam();
            $(this).parent().parent().remove();
        }

        $(this).error(function() {
            pos3 = $(this).attr("id");
            reportrefcam();
            $(this).parent().parent().remove();
        });
    });
};

myFunc();
</code></pre>
