P
P
Petr Volkhanov2017-04-27 14:55:56
css
Petr Volkhanov, 2017-04-27 14:55:56

Why might owl carousel not work?

Hello!
Why might owl carousel not work? In the head I include the owl carousel style like this:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.1/assets/owl.carousel.min.css" integrity="sha256-AWqwvQ3kg5aA5KcXpX25sYKowsX97sTCTbeo33Yfyk0=" crossorigin="anonymous" />

Below, before the closing body tag, I include javascript:
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.1/owl.carousel.min.js" integrity="sha256-s5TTOyp+xlSmsDfr/aZhg0Gz+JejYr5iTJI8JxG1SkM=" crossorigin="anonymous"></script>

But when I add the owl-carousel class to the HTML elements, the element just disappears. At the same time, there are no JS errors in the console. What could be the problem?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Mary Solar, 2017-04-27
@eprivalov

did you initialize the carousel plugin itself?
tavo type:

$(document).ready(function(){
  $(".owl-carousel").owlCarousel();
});

M
Maxim Timofeev, 2017-04-27
@webinar

Are there any errors in the console? jquery connected? 1 time connected? Is it connected after owl? And 3000 more questions, but it's easier if you give a link or errors from the console.

A
Alexey Ivanov, 2017-04-27
@mg15

If I'm not mistaken, then in the head of the site you need to add something like this:

<style type="text/css">
        #slider, .slide {height: 300px; width: 100%;}
    </style>

If these styles are not present, then in my case the height of the block was equal to zero. Maybe that's the issue?

A
Artur Karapetyan, 2017-04-27
@architawr

Possibly due to

integrity="sha256-s5TTOyp+xlSmsDfr/aZhg0Gz+JejYr5iTJI8JxG1SkM=" crossorigin="anonymous"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question