maxwellito / vivus-instant

Single page app to create independent stroke animated SVGs
329 stars 42 forks source link

Trigger Class Clarification #8

Closed gordoncc closed 6 years ago

gordoncc commented 6 years ago

Browser: Chrome 63

Hi! I'm new to Vivus and animating SVGs. I'd like to start a vivus instant animation via javascript, and I'm guessing that's what the trigger class is for. Is this correct, and if so can you please clarify or provide an example of how to do so in the documentation?

maxwellito commented 6 years ago

Hi there, For a manual trigger you will have to copy and paste the code of the SVG in your HTML. Then when you need, add the trigger class to the SVG to start the animation.

You can add an ID to the SVG to make it easier to find.

Example:

<svg id="mySVG" ...> <path ...> <path ...> <path ...> ...

This should work :) If you struggle I will provide a jsFiddle

gordoncc commented 6 years ago

Thanks for the quick reply! I had been pulling in the svgs with the object tag and that wasn't working — it's all sorted out now. You can see the results here : ) http://archetypal-abstraction.surge.sh/