title: Hide logo on scroll, doesn't trigger on scroll back to top
body: <p>I'm trying to create a function that hides a site's logo when the user starts scrolling the page and then shows it again when the user scrolls back to top. Triggering the hide part work is a breeze, but for some reason the top event is not triggered when scrolling back. By running a console log for the position I see that it reaches 0. What am I missing? </p>
  
  <pre><code>$(window).scroll( function() {
      if( $(this).scrollTop() &gt; 0 ) {
          hide_logo();
      }
      else {
          show_logo();
      }
  });
  
  function show_logo() {
      if ( $('header').offset().top &lt; 10 ) {
          $('body').animate({ marginTop: 180 }, 400);
          $('header').animate({ marginTop: 0 }, 400});
      }
  }
  
  function hide_logo() {
      if ( $('header').offset().top &lt; 10 ) {
          $('body').animate({ marginTop: 90 }, 400);
          $('header').animate({ marginTop: -90 }, 400 });
      }
  }
  </code></pre>
  
  <p>Edit: solved, see updated code.</p>