扫码关注官方订阅号
jQuery 维度函数
$(window).width() 和 $(window).height()
$(window).width()
$(window).height()
@media(宽度)
@media(高度)
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0) const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0)
window.innerWidth
window.innerHeight
@media(宽度) 和 @media (height) 其中包括滚动条
@media (height)
initial-scale
@media
在 IE8 中未定义
document.documentElement .clientWidth
.clientHeight
jQuery(window).width()
matchMedia
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
jQuery 维度函数
$(window).width()和$(window).height()跨浏览器
@media(宽度)和@media(高度)a> 值window.innerWidtha> 和window.innerHeight一个>@media(宽度) 和@media (height)其中包括滚动条initial-scale和缩放变化可能会导致移动错误缩小到 PPK 所谓的视觉视口的值并且小于@media值在 IE8 中未定义-document.documentElement .clientWidth和.clientHeight@media(宽度)和@media(高度)jQuery(window).width()jQuery 调用 浏览器视口资源
matchMedia来获取精确的任何单位的尺寸