title: How can I apply 'offset' to an element inside an iframe?
body: <p>I want to navigate to a div inside an iframe using <code>jQuery.animate</code> from a link outside the iframe. 
  This is the Code I use:</p>
  
  <pre><code>function scrollToAnchorIframe(aid){
    var aTag = window.frames['myFrame'].document.getElementById(aid);
    $('html,body').animate({scrollTop: aTag.offset().top - 62},'slow');
  }
  </code></pre>
  
  <p>However, it doesn't work, logging the error "<code>Object [object HTMLElement] has no method 'offset'</code>". Is there a way to get the offset of the id to make it work?</p>
  
  <p>Update (Solved): 
  That's the code I'm using now:</p>
  
  <pre><code>function scrollToAnchorIframe(aid){
    var aTag = window.frames['myFrame'].document.getElementById(aid);
    jQuery('html,body').animate({scrollTop: $(aTag).offset().top + $("#myFrame").offset().top - 62},'slow');
  }
  </code></pre>