Hover binds handlers for Mouse Enter and Mouse Leave and is not an event in itself. Therefore, in order to have the same effect as Hover, you will have two bindings that will fire once.
$(".button-color-2").one("mouseenter mouseleave", function(e){
dosmth();
});
If you want to do different things on mouseenter and mouseleave, then link two different handlers
$(".button-color-2").one("mouseenter", function(e){
dosmth1();
}).one("mouseleave", function(e){
dosmth2();
});
Another option is to use a hover and then undo it as soon as you are done.
$('.button-color-2').hover(function() {
dosmth();
$(this).unbind('mouseenter mouseleave')
});
source
share