Last active
July 23, 2021 00:13
-
-
Save wplit/20aa38d872ae2997aaa3dd288d2f7f45 to your computer and use it in GitHub Desktop.
allow carousel builder to work inside tabs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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