Skip to content

Instantly share code, notes, and snippets.

@cristinecula
Created August 2, 2019 11:58
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/e712c362021184349af5a2db7d09b6ab to your computer and use it in GitHub Desktop.
Save cristinecula/e712c362021184349af5a2db7d09b6ab to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/cozuyahiyo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
Test
<script id="jsbin-javascript">
const animation = document.body.animate([{opacity: 0}, {opacity: 1}], 500)
animation.cancel()
animation.onfinish = event => {
console.log('onfinish', animation.playState)
}
animation.oncancel = event => {
console.log('oncancel', animation.playState)
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">const animation = document.body.animate([{opacity: 0}, {opacity: 1}], 500)
animation.cancel()
animation.onfinish = event => {
console.log('onfinish', animation.playState)
}
animation.oncancel = event => {
console.log('oncancel', animation.playState)
}</script></body>
</html>
const animation = document.body.animate([{opacity: 0}, {opacity: 1}], 500)
animation.cancel()
animation.onfinish = event => {
console.log('onfinish', animation.playState)
}
animation.oncancel = event => {
console.log('oncancel', animation.playState)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment