About CSS Transition Start and End Events
When you use CSS animations, you can track by JavaScript, when the transition started and ended. Do that with transitionstart
and transitionend
events, as follows:
const el = document.querySelector('.animated');
el.addEventListener('transitionstart', function() {
console.log('Animation started');
});
el.addEventListener('transitionend', function() {
console.log('Animation ended');
});
Tips and Tricks Programming Web Design JavaScript HTML5 CSS3
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.