svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
10.95k stars 1.07k forks source link

how to destory an animation? #1273

Open webstermobile opened 2 years ago

webstermobile commented 2 years ago

I made a scale animation test , you can visit https://codepen.io/echolove38/pen/oNEPKVE when I click 'start' button, the rect scale from 20% to 80%, when I click 'restore' button, restore the rect scale to 1, but when I click 'start' again , the rect become smaller than before, ..... ... loop the operates, the rect become more and more small.

so, why the animation still depends on last's result. how to destory the last animation and start a new scale animation.

webstermobile commented 2 years ago

is there anyone could help

xiaoxiaohuayu commented 11 months ago

is there anyone could help

Hello, have you solved this problem? I also had the same problem,This is causing me a lot of pain

echolove38 commented 11 months ago

@xiaoxiaohuayu have not

oliverschenk commented 9 months ago

I have a similar question. I have an animation that uses loop() and runs forever. I don't know what the proper way is to stop and destroy the animation? I found a few functions like timeline().stop() or runner.unschedule(), but I have no idea if that is the right way to stop/cancel an animation...

kirkbushell commented 9 months ago

I have a similar issue - i scale 200%, works fine, but if I mouseout, it doesn't scale down back to 100% (1). In fact, mouseout doesn't seem to work at all..