animation-duration-004-manual.html (1440B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Animations Test: animation-duration - 0s</title> 4 <link rel="author" title="Nokia Inc." href="http://www.nokia.com"> 5 <link rel="author" title="Intel" href="http://www.intel.com"> 6 <link rel="reviewer" title="Zhiqiang Zhang" href="mailto:zhiqiang.zhang@intel.com"> <!-- 2015-05-05 --> 7 <link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-name"> 8 <link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-duration"> 9 <meta name="flags" content="animated"> 10 <meta name="assert" content="When animation-duration is set to 0s (zero seconds), 11 animation occurs instantaneously, there will be no animation seen."> 12 <style> 13 div { 14 animation-name: sample; 15 16 background-color: blue; 17 height: 100px; 18 width: 100px; 19 position: relative; 20 } 21 22 @keyframes sample { 23 from { 24 left: 150px; 25 } 26 to { 27 left: 0px; 28 } 29 } 30 </style> 31 <body> 32 <p> 33 Test passes if there is a filled blue square with 'Filler Text', 34 which starts staying left for about 2 seconds upon page load, 35 then moves from right to left. 36 </p> 37 <div>Filler Text</div> 38 <script> 39 var div = document.getElementsByTagName("div"); 40 div[0].style.animationDuration = "0s"; 41 setTimeout(setAnimationDuration, 2000); 42 43 function setAnimationDuration() { 44 div[0].style.animationDuration = "10s"; 45 } 46 </script> 47 </body>