jQuery adds class but does not remove

0

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');
  }
});
    
asked by anonymous 07.01.2017 / 20:17

1 answer

0

I think you can use $("#id_campo").removeAttr("class");

    
07.01.2017 / 21:34