Autoplay with fade (autoplay + classnames plugins) #363
-
|
@davidjerleke I successfully implemented the autoplay plugin with the jump parameter, but this time I'm trying to add a fade effect, and things start to be more complicated 😅 I'm pretty sure I did it in the past before the class names were extracted as a plugin. But this time, I'm not able to make it works and all slides have the It seems that the logic is within this I'd love to have your suggestion here. I created two demos: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @th-km, Thank you for your question.
That's correct. Embla needs to read the slide positions and dimensions to calculate the scroll snaps correctly before you start moving slides around. That's why you need to wait for Embla to initialize first before setting I've created a working CodeSandbox for you here: Let me know if it works as intended. Best, |
Beta Was this translation helpful? Give feedback.
Hi @th-km,
Thank you for your question.
That's correct. Embla needs to read the slide positions and dimensions to calculate the scroll snaps correctly before you start moving slides around. That's why you need to wait for Embla to initialize first before setting
position: absolute;on your slides. The optimal solution to this would be to create anembla-carousel-fadeplugin but lets see if I get time to do that in the near future. There's an is…