Q
悬停在链接
1
A
回答
2
您需要在图像和文本的父级上使用伪类:hover
。当您将鼠标悬停在该元素的任何子元素上时,这将改变图像的不透明度。
更改此
.img-box-feature:hover{opacity:1;}
这个
[class*="box-"]:hover .img-box-feature{opacity:1;}
另外,我建议你从box-um
,box-dois
改变类和box-tres
只是box
。然后,您可以使用.box:nth-child()
或.box:nth-of-type()
来定位特定的一个。
1
如果改变这一行:
.img-box-feature:hover {
opacity:1;
}
这样:
.img-box-feature:hover,
.img-box-feature.hover{
opacity:1;
}
,你可以使用jQuery来切换到新的类:
$('.over-text-feature h1 a').on('mouseenter mouseleave', function(e) {
$(this).closest('[class^="col-"]').find('.img-box-feature').toggleClass('hover');
})
0
TR y out webkit filters
例如,您可以使用对比度(%),亮度(十进制),模糊(px)或棕褐色(%)。
0
如果你想让图像激活也可以将悬停在文本上,或者只有将鼠标悬停在文本上时,它仍然不清楚。我也想知道你是否想所有图像被激活到只有一个。
如果您想所有的图像仅徘徊在文本时变得活跃,你可以移动文本元素是.section-slider
的第一个孩子,并使用CSS兄弟选择:~
。
像这样:
<section class="section-slider">
<div class="over-text-feature">
<h1><a href="#">Lorem Ipsum é simplesmente uma simulação de texto da indústria tipográfica e de impressos</a></h1>
<p>Lorem Ipsum é simplesmente uma simulação de texto da indústria tipográfica e de impressos</p>
</div>
<div class="container">
<div class="row">
<div class="col-md-6 box-um">
<div class="img-box-feature" style="background-image:url('http://lounge.obviousmag.org/a_boleia_da_ideia/2012/08/gatimonias-ou-maldita-curiosidade.html.jpg?v=20150627141437')"></div>
</div>
<div class="col-md-6 box-dois">
<div class="img-box-feature2" style="background-image:url('http://lounge.obviousmag.org/a_boleia_da_ideia/2012/08/gatimonias-ou-maldita-curiosidade.html.jpg?v=20150627141437')"></div>
</div>
<div class="col-md-6 box-tres">
<div class="img-box-feature2" style="background-image:url('http://lounge.obviousmag.org/a_boleia_da_ideia/2012/08/gatimonias-ou-maldita-curiosidade.html.jpg?v=20150627141437')"></div>
</div>
<div style="clear: both;"></div>
</div>
<div class="row">
<div class="col-md-3">01</div>
<div class="col-md-3">01</div>
<div class="col-md-3">01</div>
<div class="col-md-3">01</div>
</div>
</div>
</section>
/* SLIDER PRINCIPAL */
.section-slider{ background:#000; width: 100%;}
.img-box-feature{
width: 100%;
height: 0;
padding-bottom: 70% ; /* % of width, defines aspect ratio*/
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
background:rgba(0,0,0,0.6);
opacity:0.3;
transition: all 0.5s ease;
-webkit-transition: all 0.5s ease;
}
.img-box-feature2{
width: 100%;
height: 0;
padding-bottom: 35% ; /* % of width, defines aspect ratio*/
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
background:rgba(0,0,0,0.6);
opacity:0.3;
transition: all 0.5s ease;
-webkit-transition: all 0.5s ease;
}
.over-text-feature{ z-index:100;
position:absolute;
color:white;
display: inline-block;
vertical-align: middle;
bottom: 15px;
width: 95%;
left:10px;
border-left: 5px solid #fff;
padding-left: 10px;
}
.over-text-feature h1{ font-size: 1.8em;}
.over-text-feature h1 a{color: #00aeef;}
.section-slider .box-um{float: left; margin: 0px !important; padding: 0px !important;}
.section-slider .box-dois{float: right;margin: 0px !important; padding: 0px !important;}
.section-slider .box-tres{float: right; margin: 0px !important; padding: 0px !important;}
.over-text-feature:hover ~ .container .img-box-feature, .over-text-feature:hover ~ .container .img-box-feature2{opacity: 1;}
相关问题
- 1. 链接上悬停悬停
- 2. 悬停在其他悬停链接上
- 3. 悬停在链接上
- 4. 更改悬停在链接上时未悬停的链接文本的颜色?
- 5. 在链接悬停显示div,显示悬停的该div和链接
- 6. CSS悬停在图像问题上悬停在链接上?
- 7. 浮动链接悬停
- 8. CollapsiblePanelExtender崩溃链接悬停
- 9. CSS链接悬停动画
- 10. 链接图片悬停
- 11. :悬停链接不工作
- 12. CSS悬停div链接
- 13. css图像悬停链接
- 14. 跳跃悬停的链接
- 15. CSS链接悬停样式
- 16. jQuery setTimeout悬停链接?
- 17. 关闭链接悬停
- 18. 在悬停的每个链接上悬停的宽度比悬停的更大
- 19. jQuery:在鼠标悬停/悬停上创建链接
- 20. 如何停止链接移动悬停
- 21. 链接正在移动时,我悬停
- 22. Block:悬停在iPad上的链接
- 23. 的MouseEnter故障悬停在链接后
- 24. 模糊文本链接悬停在jQuery?
- 25. 风格悬停链接 - 与镭在镭
- 26. 子元素悬停/链接在CSS
- 27. 悬停链接将出现在图像
- 28. 在链接悬停在AIR HTML控件上显示链接
- 29. 当链接显示图像悬停在链接旁边时
- 30. AnythingSlider悬停在外部链接(MouseMove)上也有ahref链接?
这里与转化和深褐色施加bootply http://www.bootply.com/lgE3WwzWaC –