title: JQuery How to resize div while scrolling top or down
body: <p>I have problem with resizing div while screen is on the top of the page or anythere else.</p>
  
  <pre><code>$(window).scroll(function() {
      top = $('html').scrollTop();
      setTimeout(
      function() 
      {
          if(top == 0)
          {
              $(".navbar").animate({height:'70px'});
          }
          else
          {
              $(".navbar").animate({height:'43px'});
          }
      }, 100);
  
  });
  </code></pre>
  
  <p>Div <code>.navbar</code> is resizing while I'm scrolling down, but it's not getting to the original height while screen is on the top. How to resize it back? Also if you have any ideas how to make it in different way - post it.</p>
  
  <p>Thanks.</p>