This is my CSS:
.animated {
transition: 1s;
left: -400px;
}
I want to element after it class name has been set to .animated. and after it finish the transition I want to fire a function. Can someone please suggest me the idea?
This is my CSS:
.animated {
transition: 1s;
left: -400px;
}
I want to element after it class name has been set to .animated. and after it finish the transition I want to fire a function. Can someone please suggest me the idea?
You can use transitionEnd event, it's fired when a CSS transition has completed:
function showMessage() {
alert('Transition has finished');
}
var element = document.getElementById("animated");
element.addEventListener("transitionend", showMessage, false);