Skip to content

Instantly share code, notes, and snippets.

@wplit
Created November 24, 2020 00:55
Show Gist options
  • Select an option

  • Save wplit/5e7da1616dbfd6b963e925ec4391c8fc to your computer and use it in GitHub Desktop.

Select an option

Save wplit/5e7da1616dbfd6b963e925ec4391c8fc to your computer and use it in GitHub Desktop.
resize carousel when font size switch clicked.
jQuery(document).ready(function($) {
var myflkty = Flickity.data('.flickity-enabled'); // get flickity
$( ".acwp-switcher" ).on( "click", function() {. // listen for clicking the font size switches
setTimeout(function() {
myflkty.resize(); // wait 100ms, then resize the carousel
}, 100);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment