14

我试图改变 bootstrap 3 carousel 的滑动效果以淡入/淡出。我按照这里给出的说明Can the Twitter Bootstrap Carousel 插件在幻灯片过渡时淡入淡出

CSS代码在下面(在链接中说)

.carousel .item {
    -webkit-transition: opacity 3s; 
    -moz-transition: opacity 3s; 
    -ms-transition: opacity 3s; 
    -o-transition: opacity 3s; 
    transition: opacity 3s;
}
.carousel .active.left {
    left:0;
    opacity:0;
    z-index:2;
}
.carousel .next {
    left:0;
    opacity:1;
    z-index:1;
}

我的示例链接在本页的末尾,我正在制作它,但问题是上一个按钮无法正常工作,可能该解决方案非常适合 bootstrap2,我正在使用 bootstrap3,有人可以帮助我吗?提前感谢您的帮助。我是新来的,很抱歉我的英语很差,如果我问了一个愚蠢的问题!

https://dl.dropboxusercontent.com/u/35758776/xenxbd/contrastic/index.html#parallux-wrapper-04

4

2 回答 2

31

试试这个轮播淡入淡出的例子。它将向您展示如何更改上一个和下一个按钮的不透明度。

.carousel-fade .carousel-inner .item {
  opacity: 0;
  -webkit-transition-property: opacity;
  -moz-transition-property: opacity;
  -o-transition-property: opacity;
  transition-property: opacity;
}
.carousel-fade .carousel-inner .active {
  opacity: 1;
}
.carousel-fade .carousel-inner .active.left,
.carousel-fade .carousel-inner .active.right {
  left: 0;
  opacity: 0;
  z-index: 1;
}
.carousel-fade .carousel-inner .next.left,
.carousel-fade .carousel-inner .prev.right {
  opacity: 1;
}
.carousel-fade .carousel-control {
  z-index: 2;
}

http://bootply.com/86170

于 2013-10-08T10:08:44.657 回答
1

在轮播中添加类“.carousel-fade”。CSS:

.carousel-fade .active.left {
        left:0;
        opacity:0;
        -webkit-transition: opacity 1s; /*time < to $.carousel.interval setup */
        -moz-transition: opacity 1s; 
        -ms-transition: opacity1s; 
        -o-transition: opacity 1s; 
        transition: opacity  1s;
        z-index:2;

}

.carousel-fade .next {

    left:0;
    opacity:1;
    z-index:1;

}
于 2016-02-06T12:50:34.970 回答