获得绝对高度和宽度 [英] get absolute height and width

查看:142
本文介绍了获得绝对高度和宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个html元素,它有一些css,它应用在它的飞行
我想知道一个新的css类应用后它所需的确切的高度和宽度。我尝试了 offsetWidth offsetHeight ,但他们没有包括 padding margin 元素的属性。

i have an html element and it has some css which are applied on it on the fly i want to know the exact height and width it takes after a new css class is applied. I tried offsetWidth and offsetHeight but they didnt included padding and margin properties of the element.

如何获得准确值而不实际计算?可以直接使用 css 属性来完成?

How to get the exact value without actually calculating it? can it be done with a css property directly?

推荐答案

很容易: http://api.jquery.com/outerWidth/

这篇关于获得绝对高度和宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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