JavaScript AnimationEvent animationName Property
You are Here:
JavaScript AnimationEvent animationName Property
The event.animationName
property returns a string containing the name of the animation, when an animation event occurs.
Note: This property is read-only.
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<head>
<style>
h2 {
color: blue;
-webkit-animation: myMultiColor 1s infinite;
animation: myMultiColor 1s infinite;
}
/* Safari 4.0 - 8.0 */
@-webkit-keyframes myMultiColor {
from {color: blue;}
to {color: green;}
}
/* Standard syntax */
@keyframes myMultiColor {
from {color: blue;}
to {color: green;}
}
</style>
</head>
<body>
<h2 onanimationstart="myFunction(event)">Animation is Awesome</h2>
<p id="point"></p>
<script>
function myFunction(e) {
var txt = "Animation name is: " + e.animationName
document.getElementById("point").innerHTML = txt;
}
</script>
</body>
</html>
Syntax
event.animationName
Return Values
Value | Explanation |
---|---|
String | Returns a string containing the name of the CSS property associated with the transition. |
Reminder
Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JavaScript.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.