Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery-mouseenter可以在chrome中工作,但不能在firefox中工作_Jquery - Fatal编程技术网

jQuery-mouseenter可以在chrome中工作,但不能在firefox中工作

jQuery-mouseenter可以在chrome中工作,但不能在firefox中工作,jquery,Jquery,我有一点jQuery: $('#list_cont').on('mouseenter', '.show_map', function() { $(this).next('.map_cont').stop().fadeIn(800); }).on('mouseleave', '.show_map', function() { if (!$(this).next('.map_cont').is(':hover')) { $(this).next('.map_cont'

我有一点jQuery:

$('#list_cont').on('mouseenter', '.show_map', function() {
    $(this).next('.map_cont').stop().fadeIn(800);
}).on('mouseleave', '.show_map', function() {
    if (!$(this).next('.map_cont').is(':hover')) {
        $(this).next('.map_cont').delay(600).stop().fadeOut(800);
    }
});

$('#list_cont').on('mouseenter', '.show_map', function() {
    $(this).stop().show();
}).on('mouseleave', '.map_cont', function() {
    $(this).delay(600).stop().fadeOut(800);
});
它在
上显示
.map\u cont
。在
鼠标指针上显示
,然后如果将鼠标悬停在
.map\u cont
上,直到光标离开
.map\u cont
,它才会消失


这在chrome中有效,但在Firefox中无效。我不知道如何跨浏览器测试这种类型的东西。

因为
.map\u cont
#list\u cont
中,它就这样做了。因此,您需要这样定义函数:

$('.map_cont').on('mouseleave', '.show_map', function() {
    if (!$(this).next('.map_cont').is(':hover')) {
        $(this).next('.map_cont').delay(600).stop().fadeOut(800);
    }
});