naver / egjs-flicking

🎠 ♻️ Everyday 30 million people experience. It's reliable, flexible and extendable carousel.
https://naver.github.io/egjs-flicking/
MIT License
2.69k stars 129 forks source link

Is it possible to give arbitrary classes/styles to the active panel? #853

Open stefanobartoletti opened 4 months ago

stefanobartoletti commented 4 months ago

Just like the title says, it is possible to give a particular class or styles to the active panel?

I haven't found anything in the docs that can help me.

Something similar is already present on the Pagination plugin, where the "current" dot has the special class flicking-pagination-bullet-active.

Is it possible to enable something similar also for the currently active panel?

malangfox commented 3 months ago

Hello @stefanobartoletti.

We do not have an option for adding a class to the active panel, but you can implement this using the willChange and willRestore events. You can check this demo of this implementation.

Our team will discuss adding this as an option in the future, but until then, you can use the above implementation.

stefanobartoletti commented 3 months ago

Thanks for your reply, this is really handy. I will check all the API options too.

If you consider this for a future release, you may also consider some special prev and next classes to give to the immediate previous and next panels.

Thanks!