'Manipulate javascript animation exported from svgator

I noticed that there is no programmatic way to manipulate an SVG animation that was exported from SVGator. The official docs explain how you can start it by a click. But there is no way to stop it.



Solution 1:[1]

I was able to find a workaround. You can replace the following code in the svg file

i=new t(n.animations,n.options);

with

i=new t(n.animations,n.options); if (!document.__SVGATOR_) document.__SVGATOR__ = {}; document.__SVGATOR__[n.root] = i;

then you will be able to stop the animation by doing

document.__SVGATOR__['id-of-dom-element'].stop()

Solution 2:[2]

You do have the option to export with a "pause" on every second click.

example

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kirill Kulakov
Solution 2 Jeremy Caney