Skip to content

Instantly share code, notes, and snippets.

@wplit
Last active July 23, 2021 00:13
Show Gist options
  • Save wplit/20aa38d872ae2997aaa3dd288d2f7f45 to your computer and use it in GitHub Desktop.
Save wplit/20aa38d872ae2997aaa3dd288d2f7f45 to your computer and use it in GitHub Desktop.
allow carousel builder to work inside tabs
jQuery(document).ready(function($) {
if(window.angular) return;
$('.oxy-tabs').on('click', function() {
let tabContent = '#' + $(this).attr('data-oxy-tabs-contents-wrapper');
let carousels = $(tabContent).find('.oxy-carousel-builder');
carousels.each(function() {
let flkty = Flickity.data($(this).find('.flickity-enabled')[0]);
setTimeout(function() {
flkty.resize();
}, 20);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment