原文网址:https://www.youyong.top/article/1158e89f8913f
有三种方法能够确定浏览器窗口的尺寸(浏览器的视口,不包括工具栏和滚动条),基于三种,给出涵盖所有浏览器的JavaScript获取的方案。
原文网址:https://www.youyong.top/article/1158e89f8913f
有三种方法能够确定浏览器窗口的尺寸(浏览器的视口,不包括工具栏和滚动条),基于三种,给出涵盖所有浏览器的JavaScript获取的方案。
原文网址:https://www.youyong.top/article/1158e89f8913f
对于Internet Explorer、Chrome、Firefox、Opera 以及 Safari:
对于 Internet Explorer 8、7、6、5:
或者
实用的 JavaScript 方案(涵盖所有浏览器):
var w=window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var h=window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
作者声明:本篇文章系本人原创,欢迎分享,但未经许可,谢绝转载。
共 0 条留言