xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

css animation & animationend event & onanimationend

css animation & animationend event & onanimationend

https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/animationend_event

https://developer.mozilla.org/en-US/docs/Web/API/Document/animationend_event

const animated = document.querySelector('.animated');

animated.addEventListener('animationend', () => {
  console.log('Animation ended');
});


const animated = document.querySelector('.animated');

animated.onanimationend = () => {
  console.log('Animation ended');
};

animationstart event & onanimationstart

https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/animationstart_event

const animated = document.querySelector('.animated');

animated.addEventListener('animationstart', () => {
  console.log('Animation started');
});

const animated = document.querySelector('.animated');

animated.onanimationstart = () => {
  console.log('Animation started');
};


©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2020-06-05 23:07  xgqfrms  阅读(246)  评论(3编辑  收藏  举报