"#navigation #shrink "
Bootstrap 3.3.0 Snippet by SANTANU CHOWDHURY

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <nav class="navbar navbar-default navbar-fixed-top my-nav"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand logo" href="#"><img src="https://worldvectorlogo.com/logos/bootstrap-5.svg" alt="" /></a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li><a href="#">HOME</a></li> <li><a href="#">ABOUT</a></li> <li><a href="#">BLOG</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">PRODUCTS <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> <li><a href="#">CONTACT US</a></li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> <div style="height:1200px"></div>
@import url(https://fonts.googleapis.com/css?family=Roboto:400,500); .navbar-brand{ padding-top:0px !important; padding-bottom:0px !important; } .navbar{ font-size:16px; font-family: 'Roboto', sans-serif; font-weight:500; padding-top: 10px; padding-bottom: 10px; transition:all ease .3s; } .navbar-default .navbar-nav>li>a{ color:#573E7D !important; } .dropdown-menu > li > a { color:#573E7D !important; } .navbar-default .navbar-nav>li>a:hover{ color:#3B2A54 !important; } .shrink-nav { padding-top: 2px !important; /*changeable*/ padding-bottom: 0px !important; /*changeable*/ } .logo img{ margin-top:5px; width:200px !important;/*changeable*/ transition:width ease-in-out .3s; } .shrink-logo img { transition:width ease-in-out .3s; width:180px !important;/*changeable*/ } @media(max-width:767px){ .logo img{ width:200px !important;/*changeable*/ } .shrink-logo img { margin-top:10px; width:160px !important;/*changeable*/ } }
$(window).scroll(function(){ var wscroll = $(this).scrollTop(); if(wscroll > 100){ $(".navbar").addClass("shrink-nav"); $(".logo").addClass("shrink-logo"); } else{ $(".navbar").removeClass("shrink-nav"); $(".logo").removeClass("shrink-logo"); } });

Related: See More


Questions / Comments: