I am using this code to add a class to leave a fixed menu. Problem is, she's not removing the class later. How to proceed?
$(window).on('scroll', function() {
if ($(this).scrollTop() >= $('nav').offset().top) {
$('nav:not(.fixo)').addClass('fixo');
} else {
$('nav.fixo').removeClass('fixo');
}
});