Skip to content

Instantly share code, notes, and snippets.

@hehongwei44
Created July 27, 2014 07:59
Show Gist options
  • Save hehongwei44/b524ff25991d99625eb2 to your computer and use it in GitHub Desktop.
Save hehongwei44/b524ff25991d99625eb2 to your computer and use it in GitHub Desktop.
获取元素当前的高度和宽度
/*获取元素当前的高度和宽度*/
/**
* 获取元素的真实高度
* */
function getHeight(elem) {
return parseInt(getStyle(elem, 'height'));
}
/**
* 获取元素的真实宽度
* */
function getWidth(elem) {
return parseInt(getStyle(elem, 'width'));
}
@hehongwei44
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment