Hi,

I am wondering, how it would be possible to switch the navbar to burger icon on scroll via jquery. I found some hints, to try it like the following code. But it is not working. Any suggestions?

Code:
$(window).scroll(function() {
    if ($(".navbar").offset().top > 50) {
        // $(".navbar-fixed-top").addClass("top-nav-collapse");
        $('.navbar-collapse').collapse('hide');
    } else {
        // $(".navbar-fixed-top").removeClass("top-nav-collapse");
        $('.navbar-collapse').collapse('show');
    }
});
Thx
antiheld2000