I have a div that has hover:
div
.div { // css } .div:hover { // css }
But I want to disable the hover when you click on the
Try like this:
$('#myid').on({ mouseover: function(){ $(this).css({background: '#F94'}); }, mouseleave: function(){ $(this).css({background: '#DDD'}); }, click: function(){ $(this).off('mouseleave'); } });
JSFIDDLE DEMO