transition-property-005-manual.html (1245B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Transitions Test: transition-property - height width(more than one properties specified)</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" title="2.1. The 'transition-property' Property" href="http://www.w3.org/TR/css3-transitions/#transition-property-property"> 7 <meta name="assert" content="The 'transition-duration' property set more than one properties like 'height, width' 8 means only the specified properties will be transitioned."> 9 <style> 10 #test { 11 background-color: red; 12 height: 100px; 13 transition-duration: 2s; 14 transition-property: height, width; 15 transition-timing-function: linear; 16 width: 100px; 17 } 18 </style> 19 <body> 20 <p>Click the red square below. Test passes if both height and width of square grow smoothly but the color changed to green immediately.</p> 21 <div id="test"></div> 22 <script> 23 (function() { 24 var div = document.querySelector("#test"); 25 div.addEventListener("click", function(evt) { 26 div.setAttribute("style", "background-color: green; height: 200px; width: 200px;"); 27 }, false); 28 })(); 29 </script> 30 </body>