I am creating a website that requires a gallery at desktop screen widths, but has them stacked up on mobile screens. There is a .destroy() method which seems useful in my situation:
var flickity = new Flickity(this, { ... });
$(window).resize(function(){
if(window.innerWidth < 800){
flickity.destroy()
} else {
// what do I write here? it works when you recreate it like this
flickity = new Flickity(this, { ... });
// by the flickity object is already created, maybe there should be a function like this
flickity.init();
flickity.create();
}
});
These are just my thoughts on this topic, would love to know what others think, if this is desired.
I am creating a website that requires a gallery at desktop screen widths, but has them stacked up on mobile screens. There is a
.destroy()
method which seems useful in my situation:These are just my thoughts on this topic, would love to know what others think, if this is desired.