In css class "employee_mouseover" I make the bg color red.
$(".employee").bind("mouseenter", function() {
$(this).addClass("employee_mouseover");
});
$(".employee").bind("mouseleave", function() {
$(this).removeClass("employee_mouseover");
});
This works fine.
But, when I set a speed to make it look more pretty, the element stays red when I quickly do a mouseenter+mouseleave;
$(".employee").bind("mouseenter", function() {
$(this).addClass("employee_mouseover", "fast");
});
$(".employee").bind("mouseleave", function() {
$(this).removeClass("employee_mouseover", "fast");
});
This doesn't work well, unless I move in and out of the element very slowly.
Is there a better way to do this?
Thanks in advance.