metafizzy / flickity

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

Re-initialize HTML initialized carousels after Ajax/Pjax? #795

Closed 23d1 closed 6 years ago

23d1 commented 6 years ago

Is there a way to initialize elements with [data-flickity] that are found on new content after an ajax load?

I get JSON.parse(element.getAttribute('data-flickity')) to work, but sometimes the additional .resize on each carousel item doesn't work...

23d1 commented 6 years ago

Sorted it out. Had some stray local scope variables...