getting a mouseenter event from a still mouse entering an animated element

喜你入骨 提交于 2020-01-17 06:19:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!