Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation automatically replay #250

Open
MarcoGoeli opened this issue Jun 20, 2023 · 0 comments
Open

Animation automatically replay #250

MarcoGoeli opened this issue Jun 20, 2023 · 0 comments

Comments

@MarcoGoeli
Copy link

Hello
I want to automatically reset my Vivus animation so it starts again. Put simply, create a continuous loop. It doesn't work with my script.

Style CSS
#logo { width: 200px; height: auto; } #logo * { fill-opacity: 0; transition: fill-opacity 10s; } #logo.finished * { fill-opacity: 1; }

svg
<svg id="logo"... ...</svg>

js
var myVivus = new Vivus( 'logo', { type: 'oneByOne', //delayed, sync, oneByOne, script, scenario, scenario-sync duration: 30, //Animationsdauer in Frames animTimingFunction: Vivus.EASE, //Vivus.EASE, Vivus.EASE_IN, Vivus.EASE_OUT, Vivus.EASE_OUT_BOUNCE start: 'autostart', //autostart, manual, inViewport }, function (anime1) { setTimeout(function(){ anime1.reset().play(); }, 2000); }, function (obj) { obj.el.classList.add('finished') } );

I remove the following lines:
function (anime1) { setTimeout(function(){ anime1.reset().play(); }, 2000); },

then it works. What am I doing wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant