Skip to content

Instantly share code, notes, and snippets.

@alexko30
Last active August 15, 2018 13:58
Show Gist options
  • Save alexko30/16fbe575ea357f608fcd71326101d122 to your computer and use it in GitHub Desktop.
Save alexko30/16fbe575ea357f608fcd71326101d122 to your computer and use it in GitHub Desktop.
const state = document.querySelector('#tweeningState');
document.querySelector('#playPauseButton')
.addEventListener('click', toggle());
let between = new Between(0, 400)
.time(2000)
.on('pause', () => {
state.innerText = 'state: paused';
}).on('play', () => {
state.innerText = 'state: running';
});
function toggle() {
if (between.isPaused)
between.play();
else
between.pause();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment