AndrewMantarro
9/11/2017 - 12:27 AM

This code makes the menu stick to top when the menu hits the top of viewport - you will need to add fixed in CSS

This code makes the menu stick to top when the menu hits the top of viewport - you will need to add fixed in CSS

<script>
$(window).bind("load", function(){
var bottom = $('#menu').offset().top;
$(window).scroll(function(){    
    if ($(this).scrollTop() > bottom){ 
        $('#menu').addClass('sticky'); 
    }
    else{
        $('#menu').removeClass('sticky');
    }
});
    });
</script>