| <!DOCTYPE> |
| |
| <html> |
| <head> |
| <title>Position fixed with transform</title> |
| <style type="text/css" media="screen"> |
| body { |
| height: 1000px; |
| width: 1000px; |
| } |
| #fixed { |
| position: fixed; |
| width: 100px; |
| height: 100px; |
| background-color: red; |
| overflow: hidden; |
| } |
| |
| .box { |
| width: 100px; |
| height: 100px; |
| background-color: green; |
| -webkit-transform: translateZ(0); |
| } |
| |
| p { |
| position: absolute; |
| left: 50px; |
| top: 150px; |
| } |
| </style> |
| <script type="text/javascript" charset="utf-8"> |
| window.addEventListener('load', function() { |
| window.scrollBy(50, 50); |
| }, false); |
| </script> |
| </head> |
| <body> |
| |
| <p>You should see a single green square, with no red.</p> |
| <div id="fixed"> |
| <div class="box"> |
| </div> |
| </div> |
| |
| </body> |
| </html> |