How to get calculated element width and height in YUI3?

一世执手 提交于 2019-12-06 00:43:33

问题


jQuery has handy .height() and .width() utilities to get calculated displayed size of a DOM element. It also has .position() to get coordinates. In YUI3 Node, I see that there are .getX(), .getY() and .getXY() utilities to get position, but I do not see anything for size (or can't look).

What's a good way to get element height and width in YUI3?


回答1:


getComputedStyle

.getComputedStyle("width")
.getComputedStyle("height")


来源:https://stackoverflow.com/questions/3039828/how-to-get-calculated-element-width-and-height-in-yui3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!