【发布时间】:2016-10-15 04:17:47
【问题描述】:
我正在使用 Bootstrap v3.0。我将旋转幻灯片的过渡从水平更改为垂直。但是每当幻灯片发生变化时,过渡期间就会出现白色背景。如何删除它? 这是小提琴:https://jsfiddle.net/amanturate/a9gcmg1r/
我希望轮播的高度为 520 像素,如果我使用 100%,那么它不适合,我必须滚动才能看到整个轮播。
CSS 代码:
/* CUSTOMIZE THE CAROUSEL
-------------------------------------------------- */
/* Carousel base class */
.carousel {
height: 520px;
}
.carousel h1{
color: white;
}
/* Since positioning the image, we need to help out the caption */
.carousel-caption {
z-index: 10;
background-image: linear-gradient(90deg,rgba(57,55,67,0.5),rgba(12,11,17,0.5));
width: 100%;
left: 0;
padding-right: 90px;
}
/* Declare heights because of positioning of img element */
.carousel.vertical .item {
height: 520px;
background-color: #777;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.carousel-inner > .item > img {
position: absolute;
top: 0;
bottom: 0;
left: 0;
min-width: 100%;
height: 520px;
}
.carousel-caption h1{font-size: 4em;}
.carousel-caption p{font-size: 2em;}
.carousel-control{
z-index: 15;
}
.carousel-indicators{
top: 40%;
left: 100%;
margin-left: -5%;
z-index: 20;
width: auto;
padding-right: 10px;
}
.carousel-indicators li {
display: block;
margin-bottom: 5px;
}
.carousel-indicators .active {
margin-bottom: 5px;
}
/* vertical carousel*/
.vertical .carousel-inner {
height: 100%;
}
.carousel.vertical .item {
-webkit-transition: 0.6s ease-in-out top;
-moz-transition: 0.6s ease-in-out top;
-ms-transition: 0.6s ease-in-out top;
-o-transition: 0.6s ease-in-out top;
transition: 0.6s ease-in-out top;
}
.carousel.vertical .active {
top: 0;
}
.carousel.vertical .next {
top: 100%;
}
.carousel.vertical .prev {
top: -100%;
}
.carousel.vertical .next.left,
.carousel.vertical .prev.right {
top: 0%;
}
.carousel.vertical .active.left {
top: -100%;
}
.carousel.vertical .active.right {
top: 100%;
}
/*vertical carousel setting ends*/
/* carousel customization ends */
【问题讨论】:
-
问题是我想将轮播的高度设置为520px,当我设置高度时问题又出现了。
标签: javascript jquery css twitter-bootstrap carousel