gpt4 book ai didi

jquery - 在链接上禁用悬停,背景图像悬停效果会导致闪烁

转载 作者:太空宇宙 更新时间:2023-11-04 11:24:57 25 4
gpt4 key购买 nike

我目前正在处理具有悬停效果的图像。当您将鼠标悬停在图像上时,会显示一个链接。图像在悬停时具有模糊效果。问题是当您将鼠标悬停在链接(在图像顶部可见)上时,图像开始闪烁(介于模糊和不模糊之间)。

部分代码:

$(document).ready(function() {

$(".realisatieslink1").hide();
$(".realisatiesafb1").mouseenter(function() {
$(".realisatieslink1").show();
});
$(".realisatiesafb1").mouseleave(function() {
$(".realisatieslink1").hide();
});

});
.realisatieslink1 a {
padding-top: 5px;
padding-bottom: 5px;
padding-left: 15px;
padding-right: 15px;
display: inline-block;
margin-right: 10px;
margin-left: 10px;
font-size: 15px !important;
border: 1px solid white;
color: white !important;
}
.realisatieslink1 {
margin-top: -120px;
z-index: 10;
position: relative;
}
.editing .realisatieslink1 {
margin-top: 0px;
}
.realisatieslink1 p {
margin-bottom: 0px;
}
<div class="col-sm-3">

<div class="ccm-custom-style-container ccm-custom-style-slide31-83 realisatiesafb1 realisatieafb">
<a href="http://grafomantestsite2.be/index.php/realisaties">
<img src="http://grafomantestsite2.be/application/files/6314/4161/6181/realisatie1.png" alt="realisatie1.png" width="401" height="269" class="ccm-image-block img-responsive bID-83">
</a>
</div>
<div class="ccm-custom-style-container ccm-custom-style-slide31-85 realisatieslink1" style="display: none;">
<p><a href="http://grafomantestsite2.be/index.php/realisaties">BEKIJK REALISATIES</a>
</p>
</div>
</div>

有没有办法让闪烁停止?

下面是一些截图:

not hovering

Hovering

编辑:我在 CMS concrete5 工作,这限制了我编辑 HTML 的能力。刚刚发现图像效果在firefox中不闪烁,在chrome和safari中有。

编辑:图片CSS:

.realisatieafb {
width: 100%;
height: 200px;
overflow: hidden;
position: relative;
}

.realisatieafb img {
position: absolute;
left: -100%;
right: -100%;
top: -100%;
bottom: -100%;
margin: auto;
min-height: 100%;
min-width: 100%;
}

最佳答案

试试这个:

.realisatieslink1 {
margin-top: -120px;
/*z-index: 1;*/
position: absolute;
display:none;
}
.realisatieslink1:hover {
display:block;
}
.realisatieafb img{
position:relative;
}

$(document).ready(function() {
$(".realisatiesafb1").mouseenter(function() {
$(".realisatieslink1").show();
});
$(".realisatiesafb1").mouseleave(function() {
$(".realisatieslink1").hide();
});

});
.ccm-custom-style-container.ccm-custom-style-slide31-85.realisatieslink1:hover {
display: block;
}

http://jsfiddle.net/LLz19way/2/

更新:您可以在将鼠标悬停在文本上时为容器添加一个类:

  $(".realisatieslink1").mouseenter(function() {
$(".realisatiesafb").addClass('hover');
});
$(".realisatieslink1").mouseleave(function() {
$(".realisatiesafb").removeClass('hover');
});

关于jquery - 在链接上禁用悬停,背景图像悬停效果会导致闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32456362/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com