Skip to content
Snippets Groups Projects
Commit 9f22be09 authored by Martin Leblanc's avatar Martin Leblanc
Browse files

ISTWCMS-5650: Add previous next button scope per carousel

parent 7bfe0f06
No related branches found
No related tags found
1 merge request!273Feature/istwcms 5650 m26lebla owl carousel replacement
......@@ -15,14 +15,11 @@
*/
function runCarousel(id, numOfItems) {
var $carousel = $(id + ' .carousel', context);
if ($carousel.length) {
$carousel.flickity({
cellAlign: 'left',
contain: true,
pageDots: true,
prevNextButtons: false,
wrapAround: true,
wrapAround: false,
groupCells: function () {
var width = $(window).width();
if (width <= 600) {
......@@ -68,11 +65,14 @@
});
});
// previous button
$('.uw-button--previous').on( 'click', function () {
$('.uw-button--previous').on('click', function () {
var $carousel = $(this).closest('.uw-ff').find('.carousel');
$carousel.flickity('previous');
});
// next
$('.uw-button--next').on( 'click', function () {
// next button
$('.uw-button--next').on('click', function () {
var $carousel = $(this).closest('.uw-ff').find('.carousel');
$carousel.flickity('next');
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment