Home  >  Article  >  Web Front-end  >  使用documentElement正确取得当前可见区域的大小_javascript技巧

使用documentElement正确取得当前可见区域的大小_javascript技巧

WBOY
WBOYOriginal
2016-05-16 16:41:111238browse

其他方法都不适用,只有这个documentElement才能正确取得当前可见区域的大小

var w = parseInt(document.documentElement.clientWidth);
var h = parseInt(document.documentElement.clientHeight);
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn