在悬停OwlCarousel如何显示导航?

时间:2016-01-12 22:12:51

标签: jquery css owl-carousel

我试图让导航仅在旋转木马悬停但不确定如何接近时显示。我应该使用可见性切换吗?

修改

enter image description here

http://jsfiddle.net/TWtwt/470/

.owl-theme .owl-controls .owl-nav [class*=owl-] {
  color: #fff;
  font-size: 14px;
  font-family: 'KeplerStd-Regular';
  display: block;
  cursor: e-resize;
}

.owl-theme .owl-controls .owl-nav [class*=owl-]:hover {
  background-color: #1f1f1f;
  transition: 0.5s all;
  cursor: e-resize
}

1 个答案:

答案 0 :(得分:0)

您只需要在CSS代码中将owl-prevowl-next的不透明度更改为0,如下所示:

.owl-prev, .owl-next {opacity: 0 !important;}

然后,您可以在hover上定义owl-carousel操作,以显示/隐藏它,如下所示:

.owl-carousel:hover .owl-controls .owl-buttons .owl-prev {opacity: 1 !important;}
.owl-carousel:hover .owl-controls .owl-buttons .owl-next {opacity: 1 !important;}

查看工作示例HERE