phucbm / flickity-responsive

💻📱Responsive option for Flickity.
https://flickity.netlify.app
MIT License
7 stars 0 forks source link

How to destroy #21

Closed blursolo closed 1 year ago

blursolo commented 1 year ago

How can I properly destroy an instance of FlickityResponsive?

entity.flickity('destroy'); doesn't work.

phucbm commented 1 year ago

Are you using jQuery? jQuery is not fully supported in FlickityResponsive. You can initialize using jQuery but for further usage, please use the vanilla JS way.

// init
jQuery('.carousel').flickityResponsive({});

// get instance
const flkty = Flickity.data( '.carousel' );

// using API
flkty.destroy();
blursolo commented 1 year ago

@phucbm I understand. Thank you!