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

WBOY
Release: 2016-09-15 11:30:57
Original
1548 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template