Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> HTML

HTML DOM Style animationIterationCount प्रॉपर्टी


animationIterationCount प्रॉपर्टी का उपयोग एनिमेशन के चलने की संख्या को सेट या प्राप्त करने के लिए किया जाता है।

सिंटैक्स

animationIterationCount प्रॉपर्टी सेट करने के लिए सिंटैक्स निम्नलिखित है:

object.style.animationIterationCount = "number|infinite|initial|inherit"

मान

निम्नलिखित मान हैं:

क्रमांकमान एवं विवरण
1number
संख्यात्मक मान जो दर्शाता है कि एनिमेशन को कितनी बार चलाया जाना चाहिए। यह डिफ़ॉल्ट रूप से 1 पर सेट होता है।
2infinite
यह एनिमेशन को अनिश्चित काल तक चलाता है।
3initial
इस प्रॉपर्टी को उसके प्रारंभिक मान पर सेट करने के लिए।
4inherit
पैरेंट प्रॉपर्टी मान को विरासत में लेने के लिए।

उदाहरण

animationIterationCount प्रॉपर्टी का उदाहरण देखते हैं:

<!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>

आउटपुट

यह निम्नलिखित आउटपुट उत्पन्न करेगा:

HTML DOM Style animationIterationCount प्रॉपर्टी

COORDINATES बटन पर क्लिक करने और "Know your location" पॉपअप पर Allow क्लिक करने पर:

HTML DOM Style animationIterationCount प्रॉपर्टी


  1. HTML DOM Style animationTimingFunction प्रॉपर्टी HTML DOM Style animationTimingFunction प्रॉपर्टी

    animationTimingFunction का उपयोग यह निर्दिष्ट करने के लिए किया जाता है कि एनिमेशन अपने चक्र के दौरान कैसे आगे बढ़ता है। यह एनिमेशन के लिए स्पीड कर्व सेट या रिटर्न करके ऐसा करता है। स्पीड कर्व परिभाषित करता है कि संक्रमण कितने सहज होंगे, यह निर्दिष्ट करके कि एनिमेशन को एक स्थिति से दूसरी स्थिति में

  1. HTML DOM Style animationPlayState प्रॉपर्टी HTML DOM Style animationPlayState प्रॉपर्टी

    animationPlayState प्रॉपर्टी का उपयोग एनिमेशन की स्थिति को सेट या प्राप्त करने के लिए किया जाता है कि यह चल रहा है या रुका हुआ है। यह एनिमेशन को टॉगल करने में उपयोगी है। सिंटैक्स animationPlayState प्रॉपर्टी सेट करने के लिए सिंटैक्स निम्नलिखित है: object.style.animationPlayState = running|paused|in

  1. HTML DOM Style animationIterationCount प्रॉपर्टी HTML DOM Style animationIterationCount प्रॉपर्टी

    animationIterationCount प्रॉपर्टी का उपयोग एनिमेशन के चलने की संख्या को सेट या प्राप्त करने के लिए किया जाता है। सिंटैक्स animationIterationCount प्रॉपर्टी सेट करने के लिए सिंटैक्स निम्नलिखित है: object.style.animationIterationCount = number|infinite|initial|inherit मान निम्नलिखित मान हैं: क्रमां