metafizzy / flickity

:leaves: Touch, responsive, flickable carousels
https://flickity.metafizzy.co
7.52k stars 605 forks source link

Flickity won't initiate #1230

Closed Cubeva closed 1 year ago

Cubeva commented 2 years ago

Hello,

I'm using a paid Prestashop theme with support, but lately, I'm not getting an answer to an issue with the Flickity slider. Sometimes when I go to our webshop, Flickity doesn't work. The products are then placed under each other instead of next to each other and the slider does not slide and is not draggable. It happens on any browser, but more often in Firefox. On the first visit, it sometimes works, but when I go to a product page and go back to the homepage, the slider stops working and I don't even see the div elements. I've made sure that all server and browser caches are disabled.

Our webshop is still in development, but the issue can be recreated in Firefox by going to the theme site HERE. It will either not work, not (or) working when the page is refreshed or stops working after visiting a product and going back to the home page.

Our webshop is expected to open in July, can someone please help me solve this puzzle? Thank you very much!

Cubeva commented 2 years ago

Any help would be greatly appreciated.

desandro commented 1 year ago

Looks like your initializing flickity within a setTimeout. There may be a race condition where you need content to be loaded in before Flickity can be initialized. I would investigate if there's a way to do that with an event, rather than setTimeout