Disable hover on specific div(禁用特定 div 上的悬停)
问题描述
当我将鼠标悬停在我的#icon div 上时,会出现一张图片.当我从#icon 移开鼠标时,图像消失了.
When I hover over my #icon div, an image appears. When I remove the mouse from #icon the image disappears.
问题
如果我将鼠标悬停在#icon 上,则将鼠标悬停在图像将出现的空间上,图像就会出现.我已经尝试过任何方法,所以我真的希望你能提供帮助.
If I hover over the space where the image will appear if I hover over #icon, the image appears. I've tried anything, so I really hope you can help.
我需要移除 #image-divs
HTML
<div id="box">
<div id="icons1">
<div id="image1"></div>
</div>
<div id="icons2">
<div id="image2"></div>
</div>
<div id="icons3">
<div id="image3"></div>
</div>
<div id="icons4">
<div id="image4"></div>
</div>
</div>
CSS 示例
#box #icons1 #billede1 {
height: 450px;
width: 1000px;
margin-left: -186%;
margin-top: 150px;
background-image: url(../html_css/billeder/1.jpeg);
background-position: center;
background-size: cover;
opacity: 0.0;
transition: opacity 0.5s ease-in-out;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
}
推荐答案
使用pointer-events:none
div{pointer-events:none}
div:hover{color:red;}
<div>Hover over me</div>
这篇关于禁用特定 div 上的悬停的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:禁用特定 div 上的悬停


基础教程推荐
- Bootstrap 模态出现在背景下 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01