Trovin
2/27/2019 - 2:04 PM

Sticky menu js

Sticky menu js

    //init sticky menu
    function stickyMenu() {
        var winScrollTop = $(this).scrollTop();
        var element = $('.page-header');

        if(element) {
            if(winScrollTop >= 1) {
                element.addClass('page-header_sticky')
            } else {
                element.removeClass('page-header_sticky')
            }
        }
    }
    stickyMenu();
    
    
    //on scroll
    $(window).on('scroll', function () {
        stickyMenu();
    });