我在项目中使用owl-Carousel,并且在窗口调整大小和窗口负载时需要owlCarousel内的内容div(topSlidetxt)的高度,我已经尝试过此方法,但仍未得到任何积极的结果。
$('.heroSlide').owlCarousel({
smartSpeed: 1500,
items: 1,
margin:0,
nav:true,
dots:true
});
<div class="heroSlide owl-carousel">
<div class="item">
<div class="row align-items-center">
<div class="col-lg-7">
<div class="topSlideImg">
<img src="assets/images/home-banner-1.jpg" alt="">
</div>
</div>
<div class="col-lg-5">
<div class="topSlidetxt">
<span class="tiTle">South Beach Residences</span>
<h2>Icon to Many, Home to Few</h2>
<a class="linkArrow" href="#">DISCOVER MORE</a>
</div>
</div>
</div>
</div>
</div>
答案 0 :(得分:1)
您应该使用 Owl Carousel 2
中的API Events(initialized.owl.carousel,resized.owl.carousel)用法示例:
Array
(
[1] => Array
(
[id] => 50
[name] => tata
)
[2] => Array
(
[id] => 31
[name] => titi
)
[4] => Array
(
[id] => 12
[name] => tototo
)
)