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 –