maxwellito / vivus

JavaScript library to make drawing animation on SVG
MIT License
15.25k stars 1.13k forks source link

Show element after vivus animation stops #207

Closed FiddlePlus closed 6 years ago

FiddlePlus commented 6 years ago

Hey!

It's not really an issue with the vivus; more like the request of guidance.

I want to show a hidden element (img, for example, or div) after vivus is done playing. Is it possible?

I'm not trying to waste anyone's time and I'm fairly new to js, so don't be too harsh on me ;)

maxwellito commented 6 years ago

Hey there,

Don't worry about being a beginner :) The third argument of the Vivus constructor is the callback for when the animation is finished. This where you can show/hide your elements.

new Vivus('your-div', {/ your-options /}, function () { // Everything here will be called when // the animation finishes document.getElementById('hello').style.display = 'none' });

This should do the trick :)