Owlcarousel2: Using other class selector than .owl-carousel triggers unexpected behavior

Created on 25 Mar 2017  路  2Comments  路  Source: OwlCarousel2/OwlCarousel2

I'm using the following version: https://github.com/OwlCarousel2/OwlCarousel2/archive/2.2.1.zip

I have the following structure:

<div class="owl-categories owl-theme">
    <div class="item"><img src="myimg.jpg"></div>
    <div class="item"><img src="myimg.jpg"></div>
    <div class="item"><img src="myimg.jpg"></div>
</div>

Javascript used is:

$('.owl-categories').owlCarousel({ margin: 10, nav: true, center: true, });

Using the class owl-categories for the selector triggers the whole 3 items to be stacked into 1 single Carousel Item.

If I use the selector name .owl-carousel to create the instance, the behavior is normal and I get 3 slides.

Most helpful comment

.owl-carousel is mandatory. Try to use it like this:

<div class="owl-carousel categories owl-theme">

</div>

All 2 comments

.owl-carousel is mandatory. Try to use it like this:

<div class="owl-carousel categories owl-theme">

</div>

Oh! I see this changed from the previous versions. Thank you!

NOT A BUG/ ISSUE

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Laraveldeep picture Laraveldeep  路  3Comments

mkraha picture mkraha  路  4Comments

hopea114y picture hopea114y  路  3Comments

JezCheese picture JezCheese  路  3Comments

leighfarrell picture leighfarrell  路  3Comments