Better way to find all iframes on the page
<p>I am developing iPad application in that more than 6 iframes are available. After fully loaded the page, the page scroll went to the some where in the middle. So I decided to get page scrolltop written JavaScript code like this:</p>

<pre><code>$(document).ready(function() {
        try {
            var iframecompleted = [];
            $("iframe[id*='iframe']").each(function(eli, el) {
                $(this).bind("load", iframeinit);
            });
            function iframeinit() {
                iframecompleted.push($(this).id);
                $(this).unbind("load", iframeinit);
            }

            var timer = setInterval(function() {
                if ($("iframe[id*='iframe']").length == iframecompleted.length) {
                    clearInterval(timer);
                    $('html, body').animate({
                        scrollTop: 0
                    }, 500);
                    if (FrameID != "") {
                        var j = 0;
                        var ss = FrameID.split(",")
                        for (j = 0; j &lt; ss.length; j++) {
                            var collPanel = $find("pane" + ss[j]);
                            if (collPanel != null)
                                collPanel.set_Collapsed(true);
                        }
                        FrameID = "";
                    }
                }
            }, 10);
        }
        catch (e) {
            alert(e);
        }
    });
}
</code></pre>

<p>I would like to find a better way to achieve this task. Your ideas are more welcome.</p>
