Closed sanschaise closed 9 years ago
If you have multiple galleries
var $gallery = $('.gallery').flickity({ prevNextButtons: false, pageDots: true, contain:true,
});
$('.gallery-item').on( 'click', function() { $gallery.flickity( 'next', true ); });
will trigger on all the galleries on a page...
Is there a way to trigger it on $(this).parent() ?
Yes, try:
$('.gallery-item').on( 'click', function() { $(this).parents('.gallery').flickity( 'next', true ); });
Perfect!! Thank you!
If you have multiple galleries
var $gallery = $('.gallery').flickity({ prevNextButtons: false, pageDots: true, contain:true,
});
$('.gallery-item').on( 'click', function() { $gallery.flickity( 'next', true ); });
will trigger on all the galleries on a page...
Is there a way to trigger it on $(this).parent() ?