在Linux上的home上触发错误的鼠标悬停事件

Incorrect mouseover event triggered on Chome on Linux?

本文关键字:错误 鼠标 悬停 事件 Linux 上的 home      更新时间:2023-09-26

使用jQuery,我检测mouseenter事件:

// triggered when mousing over the green div
$('#dock').mouseenter(function() {
    alert('moused over!');
});

然而,如果我在我的div后面有一个选择标签,当它被打开时,这将触发mouseover事件:

    <div id="dock">
    </div>
    <div class="container">
        <select name="product_tier" id="id_product_tier">
            <option value="" selected="selected">---------</option>
            <option value="1">test-product-tier</option>
        </select>
    </div>

我已经在Chrome和Chromium 27.0.1453.93 (Windows: OK, OS X: OK, Linux: failed as描述),IE 9 (Windows: OK), Opera (Linux: OK), Firefox 21 (Linux: OK)上进行了测试。

我不能在jsFiddle或jsBin上复制它,但这里有一个要点,你可以运行:https://gist.github.com/Wilfred/5679748 .

你知道怎么回事吗?这是Chrome浏览器的bug吗?

这是jQuery 1.7+中支持的新的jQuery方式

$("#dock").on("click touchstart", function(event){
  alert($(this).text());
});

的例子:http://jsfiddle.net/yfHZE/

免责声明:我没有在Linux上尝试,但应该可以工作。