I have three responsive items (imgs), but every time the Owl-Carousel is loaded, the owl-wrapper width is two times the size of all images together. For example; if the images fullsize takes 1583 px, the owl-wrapper takes 1583 * 3 * 2 = 9498px, and all site takes this width, instead the full size (1583 px).
The issue: http://nacionalempreendimen.web2144.uni5.net
HTML
<div id="promoted-carousel">
<div class="item"><img src="assets/img/tmp/1.jpg"></div>
<div class="item"><img src="assets/img/tmp/2.jpg"></div>
<div class="item"><img src="assets/img/tmp/3.jpg"></div>
</div>
CSS
#promoted-carousel .item img{
display: block;
width: 100%;
height: auto;
}
JS
$('#promoted-carousel').owlCarousel({
autoPlay: 5000,
stopOnHover: true,
singleItem: true
});
UPDATE
I saw that when I put #promoted-carousel
div out of .page-wrapper
div, it works properly. But my knowledge of css it is not sufficient to understand why it works.
Setting of the responsive is very simple. Structure of responsive option: responsive : { // breakpoint from 0 up 0 : { option1 : value, option2 : value, ... }, // breakpoint from 480 up 480 : { option1 : value, option2 : value, ... }, // breakpoint from 768 up 768 : { option1 : value, option2 : value, ... } }
Setup. Add height to div="owl-wrapper-outer" so you can use diffrent heights on each slide. Use it only for one item per page setting.
OWL Carousel is an enabled jQuery plugin that lets you create responsive carousel sliders. Create a list of 2,232,000 OWL Carousel websites with company and contact details.
it helped me:
setTimeout(function() {
$('#promoted-carousel').owlCarousel({
autoPlay: 5000,
stopOnHover: true,
singleItem: true
});
}, 10);
this solution helped me too , if your theme is using bootstrape 4 and the owl plugin is using bootstrape 3 this will fix the owl width issue
setTimeout(function() {
$('#promoted-carousel').owlCarousel({
autoPlay: 5000,
stopOnHover: true,
singleItem: true
});
}, 10);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With