问题
I'm writing a image carousel and due to some class adding/removing my css pointer as well as my mouseenter event don't seem to work properly.
$("img", ":not(.active)").on("click", function() {
var $this = $(this);
$("img").removeClass("active");
$this.addClass("active");
goto($this.index());
});
$("img").on("mouseenter", function() {
console.log("silence");
});
function goto(i) {
$(".images").animate({
left: 55-i*310
});
}
http://jsfiddle.net/rnfkqq6s/3/
please take a look at the fiddle and watch the console. when the mouse doesn't move while clicking, the mouseenter sometimes isn't beeing triggered. the same thing with the cursor. what am I doing wrong here?
回答1:
This issue relates to a known bug:
See similar: Getting the browser cursor from "wait" to "auto" without the user moving the mouse
The bug report: https://code.google.com/p/chromium/issues/detail?id=26723#c87
来源:https://stackoverflow.com/questions/28621727/getting-a-mouseenter-event-from-a-still-mouse-entering-an-animated-element