title: Hash Change Events Keep Scroll State
body: <p>Is there any way to keep the scroll state of a user when using HTML5 onHashChange for AJAX navigation?</p>
  
  <p>For example - I have a twitter feed of 25 items, the user scrolls down to the 25th items and touch3w the box. The screen then views the individual tweet. If the user touches the back then it will use onHashChange to change the page back to the correct hash, using history.go(-1). However this process will automatically scroll back up to the top of the page - instead of keeping the scroll state, which held the user at the 25th spot.</p>
  
  <p>Is there any way of fixing this? My code sample is below:</p>
  
  <pre><code>&lt;a href="#page-2"&gt;Page 2&lt;/a&gt;
  &lt;a href="#page-3"&gt;Page 3&lt;/a&gt;
  
  $(window).bind('hashchange', function(){
  
      newHash = window.location.hash.substring(1);
  
      if (newHash){
  
          $(".page").hide();
  
          $("#"+newHash).show();
      }
      else
      {
             $(".page").hide();
             $(".page:first).show();
      }
  
  
  });
  
  $(window).trigger('hashchange');
  </code></pre>