transition-property-026-manual.html (1258B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Transitions Test: transition-property - margin-right</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://drafts.csswg.org/css-box-3/#margin-physical"> 8 <meta name="assert" content="Test checks that the 'margin-right' property is animatable."> 9 <style> 10 div { 11 float: left; 12 } 13 #ref { 14 height: 100px; 15 margin-right: 1px; 16 transition-duration: 4s; 17 transition-property: margin-right; 18 transition-timing-function: linear; 19 width: 1px; 20 } 21 #test { 22 background-color: blue; 23 height: 100px; 24 width: 100px; 25 } 26 </style> 27 <body> 28 <p>Click the blue square below. Test passes if the blue square moves gradually not immediately from left to right until it stops.</p> 29 <div id="ref"></div> 30 <div id="test"></div> 31 <script> 32 (function() { 33 var test = document.querySelector("#test"); 34 test.addEventListener("click", function(evt) { 35 document.querySelector("#ref").setAttribute("style", "margin-right: 200px;"); 36 }, false); 37 })(); 38 </script> 39 </body>