我对 owl carousel 2 有一个小问题,
这是我网站的旧版本,http://lukaszradwan.com/pl/ 请看一下主 slider 。这不是 Owl Carousel ,我不知道它是什么,但它工作正常(高度设置为 100%) - 而且它太重了。
我已经把它改成 Owl Carousel 了,看这个http://lukaszradwan.com/ 它具有响应能力,但我无法将高度设置为 100%。
JS
$('.owl-carousel').owlCarousel({
items:1,
margin:0,
loop:true,
nav:true
});
HTML
<div class="slider_container">
<div class="owl-carousel">
<div class="item"><img src="img/banners/slajd.jpg" alt="The Last of us"> </div>
<div class="item"><img src="img/banners/slajd.jpg" alt="The Last of us"></div>
<div class="item"><img src="img/banners/slajd.jpg" alt="The Last of us"></div>
</div>
</div>
</div>
如果您有任何想法,请与我分享。 提前致谢。
最佳答案
我用CSS解决了移动设备上100%高度的问题。 我知道这不是最好的解决方案,但到目前为止它有效......
.header-carousel.owl-carousel.owl-theme.owl-loaded.owl-drag,
.header-carousel .owl-stage-outer,
.header-carousel .owl-stage,
.header-carousel .owl-item,
.header-carousel .item,
.header-carousel .owl-item,
.header-carousel .img-responsive{
height: 100vh;
object-fit: cover;
}
关于javascript - Owl Carousel 100% 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29629780/