Closed Fabiato closed 8 months ago
Hi @Fabiato, glad I could be helpful with this library :)
Since this Marquee runs purely from CSS animations, I considered not to dive deep into adding so much options that users might not find helpful and what would increase the JS package bundle size.
I will consider adding that kind of option in the future releases.
But for now you can achieve that, by adding paused
class to .horizontal-marquee
/.vertical-marquee
element on page load after marquee initialization, that will help to prevent animation from playing at start.
To resume it when it comes to the viewport, you can use Intersection Observer and simply remove the paused
class.
This is the solution that I will go with for adding in the package.
Hi @Vahan0799,
Thank you for the quick response. I toggled the paused class via Intersection Observer and it works! 🍻
Hi, excellent library. Thank you! I was wondering how to pause the animation and resume it. More precisely I was thinking of activating the animation only when it enters the viewport and pausing it when it exits.