1

I need the fixed navbar to shrink 50% when it starts scrolling.

I have seen just text navbars, but nothing with a logo. Any help would be much appreciated.

http://carpetliquidators.com/demo/

You can pull the css and html from there.

jruizaranguren
  • 12,679
  • 7
  • 55
  • 73

1 Answers1

3

This can be accomplished by using jQuery and a custom CSS class, like so:

$(window).scroll(function() {
    if ($(document).scrollTop() > 150) {
        $('.navbar').addClass('shrink');
    }
    else {
        $('.navbar').removeClass('shrink');
    }
});
alex
  • 6,818
  • 9
  • 52
  • 103