transition-property-006-manual.html (1240B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Transitions Test: transition-property - background-position</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-backgrounds-3/#background-position"> 8 <meta name="assert" content="Test checks that the 'background-position' property is animatable."> 9 <style> 10 #test { 11 border: 1px solid; 12 background-image: url("support/cat.png"); 13 background-position: left; 14 background-repeat: no-repeat; 15 height: 200px; 16 transition-duration: 8s; 17 transition-property: background-position; 18 transition-timing-function: linear; 19 } 20 </style> 21 <body> 22 <p>Click the image inside of box below. Test passes if the image moves gradually but not immediately from left to right until it stops.</p> 23 <div id="test"></div> 24 <script> 25 (function() { 26 var div = document.querySelector("#test"); 27 div.addEventListener("click", function(evt) { 28 div.setAttribute("style", "background-position: right;"); 29 }, false); 30 })(); 31 </script> 32 </body>