transition-property-045-manual.html (1248B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Transitions Test: transition-property - z-index</title> 4 <link rel="author" title="Intel" href="http://www.intel.com"> 5 <link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com"> 6 <link rel="help" href="https://drafts.csswg.org/web-animations-1/#animation-type"> 7 <link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#z-index"> 8 <meta name="flags" content="ahem"> 9 <meta name="assert" content="Test checks that the 'z-index' property is animatable."> 10 <style> 11 div { 12 height: 100px; 13 width: 100px; 14 } 15 #ref { 16 background-color: red; 17 z-index: 1; 18 } 19 #test { 20 background-color: green; 21 position: relative; 22 top: -100px; 23 transition-duration: 2s; 24 transition-property: z-index; 25 transition-timing-function: linear; 26 z-index: -100; 27 } 28 </style> 29 <body> 30 <p>Click red square below. Test passes if the color of square changes to green after waiting a moment.</p> 31 <div id="ref"></div> 32 <div id="test"></div> 33 <script> 34 (function() { 35 var test = document.querySelector("#test"); 36 document.addEventListener("click", function(evt) { 37 test.setAttribute("style", "z-index: 100;"); 38 }, false); 39 })(); 40 </script> 41 </body>