Is there a jQuery shortcut for this?
$(element).on("mouseover", function() {
$(this).addClass("hover");
}).on("mouseout", function() {
$(this).removeClass("hover");
});
I see in the jQuery docs a method called hover()
, but that seems to bind on events mouseenter
and mouseleave
(should I be using those events instead of mouseover
and mouseout
?)
No comments:
Post a Comment