Created
March 30, 2016 03:44
-
-
Save reidelliott/d182ecb6c2a436513d049ec8ded2af78 to your computer and use it in GitHub Desktop.
Bootstrap Carousel Fade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Description: Enables fade transitions on BS3 carousel by simply adding a class to the `.carousel` div. | |
* Version: 1.0.0 | |
* Last update: 03/29/2016 | |
* Author: Reid Burnett <[email protected]> | |
* | |
*/ | |
.carousel-fade .carousel-inner .item { | |
opacity: 0; | |
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; | |
} | |
@media all and (transform-3d), (-webkit-transform-3d) { | |
.carousel-fade .carousel-inner > .item.next, | |
.carousel-fade .carousel-inner > .item.active.right { | |
opacity: 0; | |
-webkit-transform: translate3d(0, 0, 0); | |
transform: translate3d(0, 0, 0); | |
} | |
.carousel-fade .carousel-inner > .item.prev, | |
.carousel-fade .carousel-inner > .item.active.left { | |
opacity: 0; | |
-webkit-transform: translate3d(0, 0, 0); | |
transform: translate3d(0, 0, 0); | |
} | |
.carousel-fade .carousel-inner > .item.next.left, | |
.carousel-fade .carousel-inner > .item.prev.right, | |
.carousel-fade .carousel-inner > .item.active { | |
opacity: 1; | |
-webkit-transform: translate3d(0, 0, 0); | |
transform: translate3d(0, 0, 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment