finding index of first visible child in jquey
<p>I have a function that finds the index of the first visible child. It works but I'm wondering if there's a faster/better way to do it:</p>

<pre><code>var TheDiv = $('#' + TheDivID);
var CurrentIndex = 0;

TheDiv.children().each(function () {
    if ($(this).is(':visible')) {
        CurrentIndex = $(this).index();
        break;
    }
});
</code></pre>

<p>Thanks for your suggestions.</p>
