首页 >

javascript获得网页窗口实际大小的示例代码【javascript】

web前端|js教程javascript获得网页窗口实际大小的示例代码【javascript】
网页窗口,实际大小
web前端-js教程
javascript代码:
仿猎奇天下源码,vscode多行移动,安装的ubuntu怎样调分辨率,tomcat应用发布,生成SQLite3,苹果cms 解析插件,现如今火的前端框架,爬虫源代码干啥的,php安装图解,江西seo价钱,上传电影网站源码,静态网页下载,dw响应式网站模板下载lzw
 
function get_page_size()
{
var re = {};
if (document.documentElement && document.documentElement.clientHeight)
{
var doc = document.documentElement;
re.width = (doc.clientWidth>doc.scrollWidth)?doc.clientWidth-1:doc.scrollWidth;
re.height = (doc.clientHeight>doc.scrollHeight)?doc.clientHeight:doc.scrollHeight;
}
else
{
var doc = document.body;
re.width = (window.innerWidth>doc.scrollWidth)?window.innerWidth:doc.scrollWidth;
re.height = (window.innerHeight>doc.scrollHeight)?window.innerHeight:doc.scrollHeight;
}
return re;
}
904 viewed 3 comment(s)

代码实例:

qq综合工具箱源码,vscode怎么编两行,ubuntu启动dhcp,内嵌tomcat怎么用,python 爬虫面试,php md5性能,越秀区seo账户托管机构,源程序网站lzw
获取窗口大小function getPageSize() 
{
var re = {};
if (document.documentElement && document.documentElement.clientHeight)
{
var doc = document.documentElement;
re.width = (doc.clientWidth>doc.scrollWidth)?doc.clientWidth-1:doc.scrollWidth;
re.height = (doc.clientHeight>doc.scrollHeight)?doc.clientHeight:doc.scrollHeight;
}
else
{
var doc = document.body;
re.width = (window.innerWidth>doc.scrollWidth)?window.innerWidth:doc.scrollWidth;
re.height = (window.innerHeight>doc.scrollHeight)?window.innerHeight:doc.scrollHeight;
}
//结果输出至两个文本框
document.form1.availHeight.value= re.width;
document.form1.availWidth.value= re.height;
return re;
}
电商项目源码下载,ubuntu中国论坛,Tomcat线程已启动总数,pycharm爬虫心得,php网站学习哪里专业,什么是seo它的意义是什么lzw
浏览器窗口 的 实际高度:

浏览器窗口 的 实际宽度:


getPageSize();
window.onresize=getPageSize;


javascript获得网页窗口实际大小的示例代码【javascript】
  • js实现从中间开始往上下展开网页窗口办法【javascript】
  • js实现从中间开始往上下展开网页窗口办法【javascript】 | js实现从中间开始往上下展开网页窗口办法【javascript】 ...