theonlychase
4/11/2018 - 3:00 PM

Add and remove class on Mouseover and Mouseout

This was used on a menu that when an

  • element was hovered, it would display a different element that was absolute positioned. The below script allowed the menu to stay active on hover when the mouse was over the element.
  • jQuery('#WineClub').mouseover(function (){
        jQuery(this).addClass("active");
    });
    
    jQuery('#WineClub').mouseout(function (){
        jQuery(this).removeClass("active");
    });