如何在YUI3中获取元素的宽度和高度? [英] How to get calculated element width and height in YUI3?

查看:95
本文介绍了如何在YUI3中获取元素的宽度和高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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).

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

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

推荐答案

$ /

getComputedStyle

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

这篇关于如何在YUI3中获取元素的宽度和高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆