我使用Bootstrap的旋轉木馬進行幻燈片放映以預覽我的部分視頻。 我想在幻燈片頂部添加一個播放按鈕,並在懸停時更改不透明度。 (這個按鈕是不可點擊的,因爲href
在幻燈片上,它只是向我的用戶展示它是一個播放器。)如何在Bootstrap的傳送帶上添加播放按鈕?
但我無法讓我的div顯示所有按鈕。這裏是我的代碼:
<div class="carousel slide">
<div class="carousel-inner">
<div class="item active"><a href="popup_video1.htm"><img src="thumbnail1.jpg" /></a></div>
<div class="item"><a href="popup_video2.htm"><img src="thumbnail2.jpg" /></a></div>
<div class="item"><a href="popup_video3.htm"><img src="thumbnail3.jpg" /></a></div>
</div>
<a class="carousel-control left" href=".carousel" data-slide="prev"> </a>
<a class="carousel-control right" href=".carousel" data-slide="next"> </a>
</div>
這裏是我的CSS(它使用較少,但你的想法):
.carousel {
width: 292px;
height: 163px;
.playBtn {
width: 292px;
height: 163px;
position: relative;
opacity: 0.8;
background-image: url('play_btn.png');
background-position: center center;
background-repeat: no-repeat;
z-index: 999;
&:hover{
opacity: 1;
}
}
img {
width: 100%;
height: 100%;
}
a.carousel-control {
margin-top: 0;
top: 0;
right: 0;
background: none;
border: 0;
width: 60px;
height: 163px;
&:hover.right {
background-repeat: no-repeat;
background-image: url('right_arrow.png');
}
&:hover.left {
background-repeat: no-repeat;
background-image: url('left_arrow.png');
}
}
}
(請注意,我的播放按鈕不是幻燈片播放/暫停。 )
我在哪裏放我的<div class"playBtn"></div>
?