Skip to content

Instantly share code, notes, and snippets.

@cristinecula
Created August 2, 2019 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cristinecula/72b41ad4e5ad2985bc04956ba9eba1ac to your computer and use it in GitHub Desktop.
Save cristinecula/72b41ad4e5ad2985bc04956ba9eba1ac to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/jurudar
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://rawgit.com/web-animations/web-animations-js/master/web-animations-next.min.js"></script>
</head>
<body>
Using web animations next polyfill + workaround
<script>
const animation = document.body.animate([{opacity: 0}, {opacity: 1}], 500)
animation.onfinish = event => {
console.log('onfinish', animation.playState)
}
animation.oncancel = event => {
if(animation.playState === 'running') return;
console.log('oncancel', animation.playState)
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment