animation.ready.then(() => {
// Do whatever needs to be done when
// the animation is ready to run
});Animation: ready property / notebook
Animation: ready property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
animation.pause();
animation.ready.then(() => {
// Displays 'running'
alert(animation.playState);
});
animation.play();