在ppk关于viewport的三个言论中,分别阐述了document.documentElement.clientWidth在PC端和移动端的含义,引用他文章中的示例图如下:
在PC端中,该值代表的是浏览器视口的宽度:
而移动端中,该值代表的是整个文档的宽度,也就是ppk所定义的layout viewport。(而该值在PC端中应该是用document.documentElement.offsetWidth来表示):
为什么同一个属性在不同设备上代表的含义不同呢?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
ringa_lee