title: How can I change an IFRAME location.hash value without the parent jumping down to the IFRAME?
body: <p>I'm successfully changed the hash value for the location of an IFRAME (<a href="https://stackoverflow.com/a/9228965/866618">as a part of externalizing navigation through Google Document Viewer</a>), however I can't figure out how to stop the parent jumping down to the top of the IFRAME when the function is triggered.</p>
  
  <p>Does anyone have a JS/jQuery solution? I've found <a href="https://stackoverflow.com/a/5651372/866618">this Q&amp;A</a> (also below), but the solution seems dirty and prone to be problematic. Thoughts?</p>
  
  <pre><code>var yScroll=document.body.scrollTop;
  window.location.hash = id;
  document.body.scrollTop=yScroll;
  </code></pre>
  
  <p>Also, for reference, the function I'm using is this:</p>
  
  <pre><code>function st_go_to_pg( pg ){
      if( pg &gt;= 0) jQuery('.gde-frame').first()[0].contentWindow.location.hash=':0.page.'+pg;
  }
  </code></pre>