I have this code, which adds class active
when another element is hovered:
$(document).on('mouseenter', '.hover-cont', function(e) {
if($(window).width() <= 776) return false;
e.preventDefault();
.....addClass('active');
return false;
});
});
The problem is that, the hover event is triggered and on tap
mobile event, but I have click event for the same element which triggers another logic.
For now, I am using $(window).width() <= 776)
, but is there a way to check, which type of event is fired ?
EDIT: The click event:
$(document).on('click', '.click-el', function(e) {
e.preventDefault();
// do some logic
return false;
});