从静止的鼠标进入动画元素中获取mouseenter事件 [英] getting a mouseenter event from a still mouse entering an animated element
本文介绍了从静止的鼠标进入动画元素中获取mouseenter事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写图像轮播,由于某些类添加/删除了css指针以及mouseenter事件,因此看来无法正常工作.
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?
推荐答案
此问题与一个已知的错误有关:
This issue relates to a known bug:
看到类似的: 获取浏览器光标来自等待"到自动"无需用户移动鼠标
错误报告: https://code.google.com/p/chromium/issues/detail?id = 26723#c87
这篇关于从静止的鼠标进入动画元素中获取mouseenter事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文