Home >Backend Development >PHP Tutorial >javascript - How to correctly obtain the browser width and height on the mobile side

javascript - How to correctly obtain the browser width and height on the mobile side

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-09-15 11:30:571555browse

I usually use this to get document.documentElement.clientWidth; document.documentElement.clientHeight; but I just found out that some people don’t apply these two properties. I would like to ask how you can accurately get the width and height of the browser?

Reply content:

I usually use this to get document.documentElement.clientWidth; document.documentElement.clientHeight; but I just found out that some people don’t apply these two properties. I would like to ask how you can accurately get the width and height of the browser?

window.innerHeight gets the screen height window.innerWidth gets the screen width

window.innerHeigh

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