Skip to content

Commit

Permalink
fix: blinking issue when reversing animation (fixes: #623, #586, #503,
Browse files Browse the repository at this point in the history
  • Loading branch information
kn0wn committed Apr 7, 2020
1 parent 2dec595 commit 4d51b83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion documentation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2687,7 +2687,10 @@ <h3 class="demo-title">Reverse</h3>
easing: 'easeInOutSine'
});

document.querySelector('.reverse-anim-demo .reverse').onclick = animation.reverse;
document.querySelector('.reverse-anim-demo .reverse').onclick = () => {
animation.reverse();
animation.play();
}
/*DEMO*/
}
</script>
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,7 @@ function anime(params = {}) {

instance.reverse = function() {
toggleInstanceDirection();
instance.completed = instance.reversed ? false : true;
resetTime();
}

Expand Down

0 comments on commit 4d51b83

Please sign in to comment.