hover based on class jquery code example
Example 1: jquery hover
$( "td" ).hover(
() => {
$(this).addClass("hover");
},
() => {
$(this).removeClass("hover");
}
);
$( "td" )
.mouseover( () => {
$(this).addClass("hover");
})
.mouseout( () => {
$(this).removeClass("hover");
}
);
$( "td" )
.mouseenter( () => {
$(this).addClass("hover");
})
.mouseleave( () => {
$(this).removeClass("hover");
}
);
Example 2: on hover add class on children jquery
$(document).ready(function()
{
$('li.active').hover(
function(){
$(this).children("a").addClass("icon-white");
},
function() {
$(this).children("a").removeClass("icon-white");
}
)
});