I want to add Class using Javascript to check if sub menu overflows to offscreen and fix it if it does. I don't know how to do it but Gridlove
theme has that feature. It is made with below jQuery codes but I want to do it using Pure Javascript
:
$('.gridlove-main-nav').on('mouseenter', 'li', function(e) {
if ($(this).closest('body').width() < $(document).width()) {
$(this).find('ul').addClass('gridlove-rev');
}
});
How can I do what I want using Pure JS codes for the same function?
Website: https://miyavliyo.com/ or https://wisekitten.com/