我正在使用 YUI3 加载一些 html,如下所示:
<div id="content">
<p>This is all of my content, neat neat neat!!!!</p>
<img src="ps_logo.png" alt="Google" />
</div>
我试过使用.get('offsetHeight')
and .getComputedStyle('height')
,但都只返回 div 和段落标签的高度,并且不考虑图像的高度。因此,即使图像高 150 像素,我也会返回 73 像素。
当元素没有通过 CSS 设置时,获取 nodeList 的宽度和高度的最佳方法是什么?
谢谢您的帮助。