How can I add interactivity to my animation?

For a simpler start to adding interactivity to your animations, just click on the 'Interactivity' button beneath the animation and it will take you to a page with some basic options for your selected animation.





For the intermediates out there this is what you can do: 

You can target different values in a Lottie during runtime and use "KeyPaths" to access rotation/scale/values of a layer and object.

KeyPath values can be changed in real-time during playback by registering callbacks in combination with the Lottie-API library.

During building an animation you can name the layers/objects with the following convention so that it can be targeted like any normal HTML element when using the SVG renderer: prefix with # to give it an HTML ID, prefix with "." to give it a class name. For eg: Giving a layer the name "#person" would allow you to find and manipulate and add interactivity at runtime.

Let us point to some demos we've put together on how you can manipulate Lottie JSON in real time:

Hopefully this gets you started.


Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



Article is closed for comments.