Reduce scrolling navigation with Bootstrap 3

I am using Bootstrap 3 to develop a website. I need to create a navigation bar that should shrink as the user scrolls.
Something like - http://osticket.com
How can I create this? I use Bootstrap's bootstrap example as a starting point - http://getbootstrap.com/examples/navbar-fixed-top/

I need to place the logo on the left instead of text, and it should reduce its size when the user scrolls down.
Need help as soon as possible!
Thanks in advance.

+3
source share
3 answers

, : http://www.bootply.com/109943

$(window).scroll(function() {
  if ($(document).scrollTop() > 50) {
    $('nav').addClass('shrink');
  } else {
    $('nav').removeClass('shrink');
  }
});
+5
+3

java- script . CSS- , . . http://www.bootply.com/109943#

+2

All Articles