एनीमेशनइटरेशनकाउंट प्रॉपर्टी का उपयोग एनीमेशन के चलने की संख्या को सेट करने या प्राप्त करने के लिए किया जाता है।
सिंटैक्स
−
. के लिए वाक्य रचना निम्नलिखित हैएनीमेशनइटरेशनकाउंट प्रॉपर्टी सेट करना -
object.style.animationIterationCount = "number|infinite|initial|inherit"
मान
निम्नलिखित मान हैं -
| Sr.No | <वें शैली ="चौड़ाई:93.0612%; पाठ-संरेखण:केंद्र;">मान और विवरण|
|---|---|
| 1 | संख्या संख्यात्मक मान यह दर्शाता है कि एनिमेशन को कितनी बार चलाया जाना चाहिए। यह डिफ़ॉल्ट रूप से 1 पर सेट है। |
| 2 | अनंत यह एनीमेशन को असीम रूप से चलाने के लिए बनाता है। |
| 3 | आरंभिक इस संपत्ति को प्रारंभिक मूल्य पर सेट करने के लिए। |
| 4 | उत्तराधिकारी मूल संपत्ति मूल्य प्राप्त करने के लिए। |
उदाहरण
आइए एनीमेशनइटरेशनकाउंट प्रॉपर्टी के लिए एक उदाहरण देखें -
<!DOCTYPE html>
<html>
<head>
<style>
p {
color: black;
animation: shrink 3s;
animation-timing-function: ease;
animation-iteration-count: 1;
}
@keyframes shrink {
0% {
color: white;
letter-spacing: 1.8em;
}
100% {
color: magenta;
letter-spacing: 0.01em;
}
}
</style>
<script>
function IncreaseIteration(){
document.getElementById("PARA1").style.animationIterationCount=5;
document.getElementById("Sample").innerHTML="The animation Iteration count is now 5";
}
</script>
</head>
<body>
<p id="PARA1">Tellus elementum sagittis vitae et. Ac orci phasellus egestas tellus rutrum tellus pellentesque.</p>
<p>Click the below button to change how many times the above animation will run</p>
<button onclick="IncreaseIteration()">INCREASE COUNT</button>
<p id="Sample"></p>
</body>
</html> आउटपुट
यह निम्नलिखित आउटपुट देगा -

कोऑर्डिनेट्स बटन पर क्लिक करने और "अपना स्थान जानें" पॉपअप पर अनुमति दें क्लिक करने पर -
