Closed alvarotrigo closed 5 years ago
Describe the bug When using a negative delay in one animaiton, the previous on gets to the final position before before reaching the duration.
delay
To Reproduce Steps to reproduce the behavior:
Expected behavior Animation to stop at whatever position it is before another one gets applied to the same element.
Desktop (please complete the following information): Any device and OS
With Anime.js https://jsfiddle.net/alvarotrigo/6yev2wc0/15/
With Tweenlite: https://jsfiddle.net/alvarotrigo/6yev2wc0/18/
Code for the reproduction:
$('button').click(function() { var tl = anime.timeline({ targets: '#path', duration: 500, direction: 'normal', duration: 1000, easing: 'easeInOutQuad', }); tl.add({ d: 'M0 100 L 300 0 L 300 300.4 L 0 300 Z', }); tl.add({ d: 'M50 50 L 300 0 L 300 300.4 L 0 300 Z', delay: -800 }); });
My bad. I fixed it using the offset parameter with a negative value.
offset
https://jsfiddle.net/alvarotrigo/6yev2wc0/28/
tl.add({ d: 'M50 50 L 300 0 L 300 300.4 L 0 300 Z', }, '-=700');
Describe the bug When using a negative
delay
in one animaiton, the previous on gets to the final position before before reaching the duration.To Reproduce Steps to reproduce the behavior:
Expected behavior Animation to stop at whatever position it is before another one gets applied to the same element.
Desktop (please complete the following information): Any device and OS
With Anime.js https://jsfiddle.net/alvarotrigo/6yev2wc0/15/
With Tweenlite: https://jsfiddle.net/alvarotrigo/6yev2wc0/18/
Code for the reproduction: