owl-carousel

owl carousel - Set different items number for each of many sliders placed on the same page

别等时光非礼了梦想. 提交于 2019-12-05 18:26:44
I have a page with multiple sliders that are created with owl carousel. I would like to define different number of visible items for each slider. The perfect solution would be to define number of visible items in HTML (as a class or data). I am just starting using jQuery so I only managed to pass a value using data attribute like this: <div class="owl-carousel" data-itemsnumber="5">...</div> Then I applied this value to a variable in JS and add this variable in settings instead of items number like this. var slides = $('.owl-carousel').data('itemsnumber'); $(".owl-carousel").owlCarousel( {

Owl-Carousel, scroll two items at a time

随声附和 提交于 2019-12-05 12:53:29
I am working on a slider with Owl-Carousel 2 (beta), but there is a lot that doesn't work well. I want the owlCarousel to work like this: It should scroll 2 items at a time, showing 2 items at a time. So: [0,1] slide [2,3] slide [4,5] On mobile, it should show one picture and scroll by 1 picture at a time. owl = $('.owl-carousel') owl.owlCarousel({ center: true, loop: false, margin: 20, items: 2, responsive: { 0: { items: 1, navigation: true, nav: true }, 640: { items: 2, navigation: true, nav: true } }, scrollPerPage: true, navigation: true }).css("z-index", 0) You can use the slideBy option.

Owl Carousel 2 - autoHeight (multiple items)

好久不见. 提交于 2019-12-05 12:53:14
At the moment the Owl Carousel autoHeight works only with 1 item on screen. Their plan is to calculate all visible items and change height according to highest item. I work around this problem by calling the .active classes on the visible items, and give the invisible items a small height. Is there already a more elegant solution? $('.owl-carousel').owlCarousel({ loop: true, items: 3, margin: 1, autoHeight: true, }); Fiddle Any Ideas? Thanks! Dennis Helfensteller I solved it via the internal API using several events calling the same autoHeight-function. Fiddle The jQuery-Part: $('.owl-carousel

How come dots/navigation buttons are not visiable using owlcarousel?

痴心易碎 提交于 2019-12-05 01:22:50
How come the navigation buttons are not visible? I'm using jQuery and owlcarousel ( http://owlgraphic.com/owlcarousel/ ). http://jsfiddle.net/bobbyrne01/s10bgckL/1/ html .. <div id="owl-demo"> <div class="item"> <img src="http://placehold.it/50x50" alt="Owl Image" /> </div> <div class="item"> <img src="http://placehold.it/50x50" alt="Owl Image" /> </div> <div class="item"> <img src="http://placehold.it/50x50" alt="Owl Image" /> </div> <div class="item"> <img src="http://placehold.it/50x50" alt="Owl Image" /> </div> <div class="item"> <img src="http://placehold.it/50x50" alt="Owl Image" /> <

Owl Carousel, navigation disabled after reaching first/last item

邮差的信 提交于 2019-12-05 00:10:33
I'm trying to use owl carousel for my website. I want to disable the navigation after it reach first/last item, for example by adding "disabled" class in navigation then disable it via css. Is it possible? my code $(document).ready(function() { var owl = $("#owl-demo"); owl.owlCarousel({ rewindNav : false, pagination : false, items : 4 }); // Custom Navigation Events $(".next").click(function(){ owl.trigger('owl.next'); }) $(".prev").click(function(){ owl.trigger('owl.prev'); }) }); .item { background: #e5e5e5; margin: 10px} .btn { background: #bd0000; color: #fff; padding: 5px 10px; cursor:

How to use owl carousel vertically?

亡梦爱人 提交于 2019-12-04 19:09:24
问题 I did not want to take the plugin code so I was wondering if someone had already managed to use plugin vertically. It's a shame on the part of this plugin can be used horizontally. Sorry for langage... 回答1: Here is a CodePen that solves this: http://codepen.io/dapinitial/pen/xZaRqz $(".owl-carousel").owlCarousel({ loop: true, autoplay: true, items: 1, nav: true, autoplayHoverPause: true, animateOut: 'slideOutUp', animateIn: 'slideInUp' }); 回答2: Regard to the 2.0 beta it's currently not

Disabling Owl Carousel at a specific viewport width

非 Y 不嫁゛ 提交于 2019-12-04 17:53:23
问题 I'm currently using Owl Carousel to show a gallery on desktop/laptop sized devices. However on smaller devices I'd like to disable the plugin and show each image stacked underneath one another. Is this possible? I'm aware you can tweak Owl Carousel to show a certain number of images on screen at certain breakpoints. But I would like to be able to turn it off completely, removing all the divs etc. Here's a pen of what i'm currently working with at the moment: http://codepen.io/abbasinho/pen

How to reinit a owl carousel 2.0?

邮差的信 提交于 2019-12-04 17:47:32
问题 I know in the first version of owl carousel we do it like this : var $carousel = $('#carousel'); var owl = $carousel.data('owlCarousel'); owl.reinit({touchDrag: false, mouseDrag: false;}); Ok, but how we do it in the second version, i don't know how they renamed it. 回答1: For some reasons $('#your_carousel').trigger('destroy.owl.carousel') is not working correctly. it does not remove all classes which are needed to reinit the plugin again. You'll need to remove them completely to destroy the

Owl Carousel align each item vertically when their height not equal

前提是你 提交于 2019-12-04 16:35:53
I am working on a really simple Html/Boostrap website. I am using the owl-carousel library to display and slide multiple paragraphs. The problem is that when displaying on small devices, these paragraphs will not have the same height, depending on how long they are. I would like all my owl-item div or paragraph to be aligned vertically within the owl-wrapper div. I tried few display combinations, and also the owl carousel's autoHeight: true option but it does not work as I except. See the pictures, the little paragraph is displayed on the top of the owl-wrapper div, but I would like it to be

The clicked item should be in center in owl carousel

杀马特。学长 韩版系。学妹 提交于 2019-12-04 16:06:56
$(".owl-carousel").owlCarousel({ margin:10, dots:false, nav:true, responsive:{ 0:{ items:1 }, 600:{ items:3 }, 1000:{ items:5 } } }); The Above is my Owl carousel. Now i need clicked owl-item should be center. please any me You can trigger the to.owl.carousel event when the user clicks on the item. This event causes the Owl Carousel to move to a specific position. I've set the data-position attribute for each div inside the carousel before initializing the carousel. Then I use this attribute as a parameter of the to.owl.carousel event. Please check the result: https://codepen.io/glebkema