Scrolling main document after iframe has finished loading

Scrolling main document after iframe has finished loading

Hi all, I've got a tricky problem

I have a long (more that one screen) document, which has a iframe in the bottom. The iframe target URL contains a "bookmark" (hash mark) to scroll the iframe contents, like this:
  1. <iframe src="document.html#bookmark"></iframe>
The problem with this is that the main document also scrolls down to show the bookmark in the iframe!

So I tried to solve this with a little jQuery in the main document, but I can't get it to work as it should:
  1. $('iframe').ready(function () {
  2.         //alert('hello world');
  3.         $(document).scrollTop(0);
  4. });
The alert show that the function is triggered (and having it enabled, actually prevents the document from scrolling down), but the scrollTop() is not executed...