Firefox/IE jQuery is(":hover") not working

Firefox/IE jQuery is(":hover") not working

本文关键字:quot hover not working is Firefox IE jQuery      更新时间:2023-09-26

http://jsfiddle.net/h8rxa3pj/2/

$("#open_link").hover(function() {
    $("#menu").removeClass("hidden");
},function() {
    if ($("#menu").is(":hover")) {
        $("#menu").mouseleave(function() {
            $("#menu").addClass("hidden");
        });
    }
    else {
        $("#menu").addClass("hidden");
    };
});

我已经查看了有关此的其他问题,并尝试几乎所有解决方案,除了我无法理解的解决方案。

如何检查鼠标是否在jQuery中的元素上?

我觉得Arthur的回答可能会有所帮助,但我对jQuery/JS真的很陌生,我不知道如何在这里应用它。感谢帮助

$("#open_link, #menu").hover(function() {
    $("#menu").removeClass("hidden");
});
$("#open_link, #menu").mouseleave(function() {
    $("#menu").addClass("hidden");
});