Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.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 试图实现onmouseover/onmouseout效果_Jquery_Css - Fatal编程技术网

Jquery 试图实现onmouseover/onmouseout效果

Jquery 试图实现onmouseover/onmouseout效果,jquery,css,Jquery,Css,我正在尝试实现这种“圆/层”效果() 我的jQuery技能很糟糕:(到目前为止,我就是这么做的 HTML <body style="margin:0; padding:0;"> <div class="container"> <div class="bubble-container bubble-a"> <a class="gps_ring" href="javascript:void(0);"> &

我正在尝试实现这种“圆/层”效果()

我的jQuery技能很糟糕:(到目前为止,我就是这么做的

HTML

<body style="margin:0; padding:0;">
<div class="container">
    <div class="bubble-container bubble-a">
        <a class="gps_ring" href="javascript:void(0);">
            <div class="dot">dot</div>
        </a>
        <div class="layer">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
        </div>
    </div>
    <div class="bubble-container bubble-b">
        <a class="gps_ring" href="javascript:void(0);">
            <div class="dot">dot</div>
        </a>
        <div class="layer">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
        </div>
    </div>
    <div class="bubble-container bubble-c">
        <a class="gps_ring" href="javascript:void(0);">
            <div class="dot">dot</div>
        </a>
        <div class="layer">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
        </div>
    </div>
</div>
</body>
jQuery

$(".bubble-container .gps_ring").hover(function(){
    $(this).next().show();
    $(this).next().focus();
});

$(".layer").mouseleave(function(){
    $(this).hide();
});

有时候鼠标出来的时候,白色层不会隐藏,你知道为什么吗

此外,我想设置红点可见时,我在白色层太

谢谢

$(".bubble-container").hover(function(){
    $(this).find('.gps_ring').next('.layer').show();
},function(){
    $(this).find('.gps_ring').next('.layer').hide();
});

或者您可以直接使用.find()

或者您可以直接使用.find()

或者您可以直接使用.find()

或者您可以直接使用.find()


要在悬停时保留红点,您需要添加一个.hovered类来表示活动链接。$(this).find('.dot').addClass('hovered')和.removeClass('hovered')css:.gps_ring:hover div.dot、.gps_ring div.dot.hovered{背景色:#ef4036;}谢谢@mohamed yousef!!!!那白色圆圈内的红色圆圈呢?有没有办法在指针位于白色图层上时使红色圆圈可见?谢谢你的帮助!哦!谢谢@huwman!!我现在就试试你的解决方案!!:)别担心!我在我的页面中测试了你的代码,并且正在运行!谢谢你们两个!!爱你们所有人!!:)要在悬停时保留红点,需要添加一个.hovered类来表示活动链接$(此).find('.dot').addClass('hovered')和.removeClass('hovered')css:.gps\u ring:hover div.dot、.gps\u ring div.dot.hovered{背景色:#ef4036;}谢谢@mohamed yousef!!!!白色圆圈里的红色圆圈呢?当指针位于白色层上时,有没有办法使红色圆圈可见?我感谢你的帮助!哦谢谢@huwman!!我现在就试试你的解决方案!!:)别担心!我在我的页面中测试了你的代码,并且正在运行!谢谢你们两个!!爱你们所有人!!:)要在悬停时保留红点,需要添加一个.hovered类来表示活动链接$(此).find('.dot').addClass('hovered')和.removeClass('hovered')css:.gps\u ring:hover div.dot、.gps\u ring div.dot.hovered{背景色:#ef4036;}谢谢@mohamed yousef!!!!白色圆圈里的红色圆圈呢?当指针位于白色层上时,有没有办法使红色圆圈可见?我感谢你的帮助!哦谢谢@huwman!!我现在就试试你的解决方案!!:)别担心!我在我的页面中测试了你的代码,并且正在运行!谢谢你们两个!!爱你们所有人!!:)要在悬停时保留红点,需要添加一个.hovered类来表示活动链接$(此).find('.dot').addClass('hovered')和.removeClass('hovered')css:.gps\u ring:hover div.dot、.gps\u ring div.dot.hovered{背景色:#ef4036;}谢谢@mohamed yousef!!!!白色圆圈里的红色圆圈呢?当指针位于白色层上时,有没有办法使红色圆圈可见?我感谢你的帮助!哦谢谢@huwman!!我现在就试试你的解决方案!!:)别担心!我在我的页面中测试了你的代码,并且正在运行!谢谢你们两个!!爱你们所有人!!:)
$(".bubble-container").hover(function(){
    $(this).find('.gps_ring').next('.layer').show();
},function(){
    $(this).find('.gps_ring').next('.layer').hide();
});
$(".bubble-container").hover(function(){
    $(this).find('.layer').show();
},function(){
    $(this).find('.layer').hide();
});