Created
April 5, 2010 20:18
-
-
Save dandean/356818 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Does Prototype's Element.Layout pull transformed values? Not yet.</title> | |
| <style type="text/css" media="screen"> | |
| div#stage { | |
| width: 100px; | |
| height: 100px; | |
| background: #CCC; | |
| -webkit-transform-origin: left top; | |
| -webkit-transform: scale(2); | |
| } | |
| </style> | |
| <script src="http://prototypejs.org/assets/2010/4/1/prototype.js" type="text/javascript" charset="utf-8"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| document.on("dom:loaded", function() { | |
| console.log($("stage").measure("width")); | |
| //-> 100 | |
| console.log($("stage").getBoundingClientRect().width); | |
| //-> 200 | |
| console.log($("stage").offsetWidth); | |
| //-> 100 | |
| console.log($("stage").clientWidth); | |
| //-> 100 | |
| }); | |
| </script> | |
| </head> | |
| <body> | |
| <div id="stage"> | |
| Stage! | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment