M
M
MFNIK2019-03-12 22:07:55
JavaScript
MFNIK, 2019-03-12 22:07:55

Is it possible to somehow connect the Owl Carousel carousel if there are more than n elements?

Good afternoon!
Please tell me, there is a horizontal menu, very long words of items.
The length fits only at a resolution above 1450px.
The customer suggested doing something like a carousel.
It's really possible to do it on Owl Carousel under the following conditions:
1) Turn on the carousel if there are more than 5 elements
2) Turn on the carousel if the resolution is less than 1450px.
If someone can write such a script, I'm ready to thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
devilsD, 2019-03-12
@MFNIK

Here the carousel will turn on if there are more than 5 elements. If the resolution is less than 1450, then the carousel will turn on when there are 3 elements, respectively, 3 elements will also be displayed on the screen.

$('.owl-carousel').owlCarousel({
    responsiveClass:true,
    responsive:{
        0:{
            items: 3,
        },
        1450:{
            items:  5,
        }
    }
})

M
MFNIK, 2019-03-12
@MFNIK

This is not at all what is needed.
It turns out that the carousel is always on, but you need it to be connected if there are more elements than the width. Those if the elements do not fit in the container in which these elements are located, then scrolling is enabled.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question