I have the css code:
body.start{-webkit-animation:srcb ease-in .4s 1;}
and just play once when entered the website
but the problem
Here is the code:
var div = document.querySelector('div');
function callback() {
div.classList.remove('start'); // or modify div.className
}
div.addEventListener("webkitAnimationEnd", callback, false);
Check this live example on jsbin.
Please notice, that your animation and my solution work only in webkit-based browsers. In production environment you should take into consideration other browsers and mandatory provide prefix-free solution.