jQuery-mouseenter可以在chrome中工作,但不能在firefox中工作
我有一点jQuery: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'
$('#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);
}
});