如何在YUI3中获得计算的元素宽度和高度?

Jaa*_*nus 6 jquery yui dom

jQuery有方便的.height()和.width()实用程序来计算DOM元素的显示大小.它还有.position()来获取坐标.在YUI3 Node中,我看到有.getX(),. getY()和.getXY()实用程序来获取位置,但我没有看到任何大小(或看不到).

在YUI3中获取元素高度和宽度的好方法是什么?

Tiv*_*vac 11

的getComputedStyle

.getComputedStyle("width")
.getComputedStyle("height")
Run Code Online (Sandbox Code Playgroud)