I need to add a class to an li
on hover but remove the same class from all other li
s in the list (this is for a nav).
The code I have so far is:
jQuery(".navcontent").on('mouseenter', 'li', function() {
if (jQuery('.childmenu', this)) {
jQuery('.childmenu', this).addClass("child-active");
} else {
jQuery('.navcontent li .childmenu').removeClass("child-active");
}
});
I can't quite work out what I need to do...
Any help would be much appreciated.