【发布时间】:2016-09-20 07:34:45
【问题描述】:
我使用 owl carousel,我想要幻灯片上方的导航以便轻松导航。现在它们被隐藏或在滑块下方。我不知道如何将它们放在上面。我在CSS 中尝试了 z-index 用于轮播和导航,但没有任何反应。需要帮助,谢谢!
JS
<script>
$(document).ready(function() {
$("#owl-demo2").owlCarousel({
navigation : true, // Show next and prev buttons
slideSpeed : 300,
paginationSpeed : 400,
items : 1,
itemsDesktop : false,
itemsDesktopSmall : false,
itemsTablet: false,
itemsMobile : false
});
});
</script>
CSS
#owl-demo2 .item img{
display: block;
width: 100%;
height: auto;
position: relative;
z-index: 1;
}
.owl-theme .owl-controls .owl-buttons div{
color: #FFF;
display: inline-block;
zoom: 1;
position: fixed;
z-index: 2000;
*display: inline;/*IE7 life-saver */
margin: 90px;
padding: 20px 0px;
font-size: 12px;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
background: #869791;
filter: Alpha(Opacity=50);/*IE7 fix*/
opacity: 0.5;
}
.owl-buttons {
position: absolute !important;
top: -45px !important;
left: 50% !important;
transform: translateX(-50%)!important;
}
【问题讨论】:
-
你能在 JSfiddle 上展示一个工作演示吗?
-
我可以把我所有的代码放在 jsfiddle 上,但是例子在这里 link 我希望它对你来说已经足够了,谢谢
标签: css owl-carousel