owl-carousel-2

Show part of next and previous items with Owl Carousel 2.0

余生长醉 提交于 2019-11-27 14:36:12
问题 I'm using Owl Carousel 2.0. I would like to show one item, a half (or less) of the previous item (left side) and a half (or less) of the next item (right side). Just putting a part of them out on the right and on the left side: I've been trying using just CSS ( padding and margin negative with the owl-stage-outer ) but obviously Javascript override them. Here's my code so far: $('.owl-carousel').owlCarousel({ loop: true, margin: 10, nav: true, responsive: { 0: { items: 1 }, 600: { items: 3 }

How to re-render a owl-carousel item?

泪湿孤枕 提交于 2019-11-27 05:46:09
问题 Well, I'm using a owl-carousel-2 plugin now. And I encounter the following problem: The markup code: <div class="owl-carousel" style="display: none;"> <div class="item"><img src="..." /></div> <div class="item"><img src="..." /></div> <!-- ... --> <div class="item"><img src="..." /></div> </div> <script> $(function() { var $owl = $('.owl-carousel'); $owl.owlCarousel(); // Doing many things here. $owl.show(); }); </script> The problem is: When I initialize with the $owl.owlCarousel();

Owl Carousel 2 - Get src of current slide

▼魔方 西西 提交于 2019-11-27 02:48:49
问题 I have the following code blocks. All i'm trying to do is get the src of the current image in the slide show. It's not working, nothing appears in the console at all despite it changing slide fine. HTML: <div id="banner" class="owl-carousel"> <img src="template/banner-1.jpg" alt=""> <img src="template/banner-2.jpg" alt=""> <img src="template/banner-1.jpg" alt=""> <img src="template/banner-2.jpg" alt=""> </div> jQuery: var owl = $(".owl-carousel"); owl.owlCarousel({ loop: true, autoplay: true,

How to reinitialize Owl Carousel after ajax call?

南笙酒味 提交于 2019-11-26 23:25:32
问题 I am trying to reinitialize owl carousel after a successful ajax call. The ajax call will change the data but the view should stay the same.I am having an issue where the view carousel structure will not reinitialize. I don't know where I did mistake. Ajax Request $(document).on('click', '.category_list', function() { var category_id = $(this).attr('data-id'); var _token = $('#_token').val(); var param = 'category_id=' + category_id + '&_token=' + _token; $.ajax({ type: "POST", datatype:

How do I add classes to items in Owl Carousel 2?

人盡茶涼 提交于 2019-11-26 22:51:37
问题 My goal is to make a carousel that looks like this: In case you don't know what you're looking at, there are 5 images/items but only the center one is displayed in its full size. The images next to the center one are smaller, and the outer ones smaller still. I've achieved this in the first version of Owl Carousel but it doesn't support looping, which makes this design ridiculous (can't reach the side images...). Here's how I did it: var owl = $("#owl-demo"); owl.owlCarousel({ pagination: