I am using owl carousel and it works perfectly except it does not support circular/infinite scrolling. I did search for ideas on google and stackoverflow with no luck. Has anyone implemented circular/infinite scrolling in owl carousel?
相关问题
- jQuery Plugin to simulate browser page zoom/text z
- How to handle special characters in html element i
- Adding jQuery custom image tool tip to jsTree
- jQuery drag and drop ul and li elements
- Jquery Corners produces a white background. I need
相关文章
- autocomplete showing self.element.propAttr error
- comma separated auto complete with jquery auto com
- jstree checkbox checked on load
- Cloned items in owl carousel
- Is it possible to implement a circular/infinite ca
- Jquery Flot “plothover” event not working
- jQuery submit() doesn't include submitted butt
- Extracting filtered table data
Owl Carousel does have the
loop: true
configuration setting. But, there's a few problems I don't like:To that end I've found and recommend using the Slick Carousel instead. Slick has a "Center Mode" which had exactly the functionality I was looking for:
http://kenwheeler.github.io/slick/
I was able to accomplish it using jquery/php/ajax. Here is how I did it:
1) First you need to initially place the first x amount of images on the page which will technically be the first page and then afterwards you'll load via ajax each time you reach the end of the carousel. In the example script I supplied I am getting a list of images from a fictional database table called "images". In my php script, for this particular example, it will return 24 owl-item divs with content. For this example I will loading 24 images at a time on the first page initially and then ajax will attempt to return 24 more each time.
HTML (You will need to add the first items into the carousel div and these items will technically be the first page of items. You could use php to populate the divs/image source for the initial first page. Just use regular divs like I did below because the carousel will add the owl-item class to them once it initializes).
Javascript (This javascript goes on the same page as the HTML above.)
PHP SCRIPT (Create a php file and this should be the page that is used in the ajax url in the JavaScript i.e. $.ajax({method: "GET",url: "/path/to/php/script"..... )
That's pretty much it. Easy as pie. Works pretty well too. If the browser resizes and causes the owl items to resize as well, it does reset the carousel back to the first item but I figured out how to add the items to the object so it doesnt mess things up and that is already included in the JavaScript. Let me know if you have any issues and I might be able to help fix them. Been working on this several days and just got this working so I haven't had time to extensively test it but I know it works on mobile phones, both iPhone and Android and works on iPads as well as on desktop browsers. Have fun!
No.They said that carousel doesn't support circular slides. Possibly this may help:
But this works only with navigation arrows, not with responsive slides =(
Or you may huck it somehow)