title: Fix navbar elements size when navbar shrinks
body: <p>I have a fixed-top navbar, i made a function to make it shrink on scroll but i have a problem, the ul class in the navbar is not shrinking properly, i gave it a line height to align it vertically with the navbar-brand but i can't figure out how to fix that when the navbar shrinks, here is my code: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function(){
    var scrollTop = 0;
    $(window).scroll(function(){
      scrollTop = $(window).scrollTop();
       $('.counter').html(scrollTop);
      
      if (scrollTop &gt;= 100) {
        $('#global-nav').addClass('scrolled-nav');
      } else if (scrollTop &lt; 100) {
        $('#global-nav').removeClass('scrolled-nav');
      } 
      
    }); 
    
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#global-nav{
  height: 150px;
    -webkit-transition: height .5s, line-height .5s;
    transition: height .5s, line-height .5s;
  }
  
  .navbar-brand img{
  height:95px;
  }
  
  .navbar-default .navbar-nav&gt;li&gt;a{
     line-height: 95px;
     }
     
     .navbar-brand
    img{
     display: inline-block;
     -webkit-transition: all .5s;
     transition: all .5s;
  }
  .scrolled-nav .navbar-brand img{
    height: 50px;
  }
  .scrolled-nav{
    height: 100px !important;
    line-height: 100px !important;
  }
  .counter{
    width: 20px;
    height: 20px;
    background: black;
    color: #fff;
    position: fixed;
    top: 120px;
    right: 0;
    }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"&gt;
  
  &lt;nav id="global-nav" class="navbar navbar-default navbar-custom navbar-fixed-top"&gt;
     &lt;div class="container"&gt;
              &lt;div class="navbar-header"&gt;
                  &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"&gt; &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;/button&gt;
                  &lt;a class="navbar-brand page-scroll" href="#page-top"&gt;&lt;img src="http://placehold.it/350x150"&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"&gt;
                  &lt;ul class="nav navbar-nav navbar-right"&gt;
                      &lt;li class="hidden"&gt;
                          &lt;a href="#"&gt;&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li class="active"&gt; &lt;a href="#"&gt;LINK 1&lt;/a&gt; &lt;/li&gt;
                      &lt;li&gt; &lt;a href="#"&gt;LINK 2&lt;/a&gt; &lt;/li&gt;
              
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/div&gt;
   &lt;/nav&gt;
   
   &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>