title: Scroll to Top does not work after hiding elements (jQuery)
body: <p>Currently I have a function for my menu that scrolls to different divs on the page, as a form of navigation. Currently I'm using the following method.</p>
  
  <p>Scroll to Portfolio</p>
  
  <pre><code>$("html, body").animate({ scrollTop: $('#portfolio').offset().top }, 600);
  </code></pre>
  
  <p>Since I'm building the entire page dynamically, when someone clicks on a link, I am using .hide() to hide main page elements, and generating additional content.</p>
  
  <pre><code>function hideElements() {
  
  $("#something").hide();
  
  }
  </code></pre>
  
  <p>While on the content page, if they want to go back to portfolio, they click on the portfolio link again. I'm using the following method to "scroll" them to the re-shown element.</p>
  
  <pre><code>$("#nav").click(){
      unhideMainElements();
      $("html, body").animate({ scrollTop: $('#portfolio').offset().top }, 1200);
      $("#container").fadeIn(300);
  }
  </code></pre>
  
  <p><strong>The problem is, the fade will work, but it won't scroll to the element. I'd figure it has to do with .hide() the element and .show() the element, but I don't know why. I appreciate any insight. Thanks!</strong></p>