CSS एनिमेशन-फिल-मोड संपत्ति
उदाहरण
एनीमेशन समाप्त होने पर <div> तत्व को अंतिम कीफ़्रेम से शैली मान बनाए रखने दें:
div {
animation-fill-mode: forwards;
}
नीचे और अधिक "इसे स्वयं आज़माएं" उदाहरण।
परिभाषा और उपयोग
animation-fill-mode
जब ऐनिमेशन नहीं चल रहा हो तो प्रॉपर्टी उस तत्व के लिए शैली निर्दिष्ट करती है (शुरू होने से पहले, समाप्त होने के बाद, या दोनों) ।
पहली कीफ़्रेम चलाने से पहले या अंतिम कीफ़्रेम चलाने के बाद CSS एनिमेशन तत्व को प्रभावित नहीं करते हैं। संपत्ति इस animation-fill-mode
व्यवहार को ओवरराइड कर सकती है।
डिफ़ॉल्ट मान: | कोई नहीं |
---|---|
विरासत में मिला: | नहीं |
एनिमेटेबल: | नहीं। एनिमेटेबल के बारे में पढ़ें |
संस्करण: | CSS3 |
जावास्क्रिप्ट सिंटैक्स: | ऑब्जेक्ट .style.animationFillMode="forward" |
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो पूरी तरह से संपत्ति का समर्थन करता है।
-वेबकिट-, -मोज़-, या -ओ- के बाद नंबर एक उपसर्ग के साथ काम करने वाले पहले संस्करण को निर्दिष्ट करें।
Property | |||||
---|---|---|---|---|---|
animation-fill-mode | 43.0 4.0 -webkit- |
10.0 | 16.0 5.0 -moz- |
9.0 4.0 -webkit- |
30.0 15.0 -webkit- 12.1 12.0 -o- |
सीएसएस सिंटेक्स
animation-fill-mode: none|forwards|backwards|both|initial|inherit;
सम्पत्ति की कीमत
Value | Description |
---|---|
none | Default value. Animation will not apply any styles to the element before or after it is executing |
forwards | The element will retain the style values that is set by the last keyframe (depends on animation-direction and animation-iteration-count) |
backwards | The element will get the style values that is set by the first keyframe (depends on animation-direction), and retain this during the animation-delay period |
both | The animation will follow the rules for both forwards and backwards, extending the animation properties in both directions |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
और ज्यादा उदाहरण
उदाहरण
एनीमेशन शुरू होने से पहले <div> तत्व को पहले कीफ्रेम द्वारा निर्धारित शैली मान प्राप्त करने दें (एनीमेशन-विलंब अवधि के दौरान):
div {
animation-fill-mode: backwards;
}
उदाहरण
एनीमेशन शुरू होने से पहले <div> तत्व को पहले कीफ़्रेम द्वारा निर्धारित शैली मान प्राप्त करने दें, और एनीमेशन समाप्त होने पर अंतिम कीफ़्रेम से शैली मान बनाए रखें:
div {
animation-fill-mode: both;
}
संबंधित पृष्ठ
सीएसएस ट्यूटोरियल: सीएसएस एनिमेशन
एचटीएमएल डोम संदर्भ: एनीमेशनफिलमोड संपत्ति