简体   繁体   English

Firefox / IE jQuery无法运行(“:hover”)

[英]Firefox/IE jQuery is(“:hover”) not working

http://jsfiddle.net/h8rxa3pj/2/ 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");
    };
});

I have looked at the other questions on this and tried pretty much every solution except the ones I couldn't understand. 已经看过这个的其他问题,并试图相当多,除了那些我无法理解每一个解决方案。

How do I check if the mouse is over an element in jQuery? 如何检查鼠标是否在jQuery中的元素上?

I feel like Arthur's answer could help but I'm really new to jQuery/JS and I don't know how to apply it here. 我觉得Arthur的答案可能会有所帮助,但是我真的是jQuery / JS的新手,我不知道如何在这里应用它。 Help appreciated 感谢帮助

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM