js中获取宽高
<script type="text/javascript">
function getWH() {
var a = "";
a += " 网页可见区域宽:" + document.body.clientWidth + "\n";
a += " 网页可见区域高:" + document.body.clientHeight + "\n";
a += " 网页可见区域宽:" + document.body.offsetWidth + " (包括边线和滚动条的宽)" + "\n";
a += " 网页可见区域高:" + document.body.offsetHeight + " (包括边线的宽)" + "\n";
a += " 网页正文全文宽:" + document.body.scrollWidth + "\n";
a += " 网页正文全文高:" + document.body.scrollHeight + "\n";
a += " 网页被卷去的高(ff):" + document.body.scrollTop + "\n";
a += " 网页被卷去的高(ie):" + document.documentElement.scrollTop + "\n";
a += " 网页被卷去的左:" + document.body.scrollLeft + "\n";
a += " 网页正文部分上:" + window.screenTop + "\n";
a += " 网页正文部分左:" + window.screenLeft + "\n";
a += " 屏幕分辨率的高:" + window.screen.height + "\n";
a += " 屏幕分辨率的宽:" + window.screen.width + "\n";
a += " 屏幕可用工作区高度:" + window.screen.availHeight + "\n";
a += " 屏幕可用工作区宽度:" + window.screen.availWidth + "\n";
a += " 你的屏幕设置是 " + window.screen.colorDepth + " 位彩色" + "\n";
a += " 你的屏幕设置 " + window.screen.deviceXDPI + " 像素/英寸" + "\n";
alert(a);
}
</script>
js中获取宽高的更多相关文章
- DOM中获取宽高、位置总结
原生JS 一.文档.窗口的宽高和位置 // 获取屏幕的宽高 window.screen.height | window.screen.width // 屏幕可用工作区宽高 window.screen. ...
- Adatper中获取宽高为0的问题
但是我们想在getView()中获取ImageView的宽和高存在问题,在getView()里面刚开始显示item的时候利用ImageView.getWidth() 获取的都是0,为什么刚开始获取不到 ...
- js中各种宽高
各种宽高 Javascript: IE中:document.body.clientWidth ==> BODY对象宽度document.body.clientHeight ==> BODY ...
- JS中的宽高(基础知识很重要)
IE中:document.body.clientWidth ==> BODY对象宽度document.body.clientHeight ==> BODY对象高度document.docu ...
- JS浏览器获取宽高
screen.availHeight is the height the browser's window can have if it is maximized. (including all th ...
- 不依赖三方库从图像数据中获取宽高-gif、bmp、png、jepg
int extract_pic_info(const BYTE *pic, const uint32_t size, int &width, int &height) { ; widt ...
- js实现未知宽高的元素在指定元素中垂直水平居中
js实现未知宽高的元素在指定元素中垂直水平居中:本章节介绍一下如何实现未知宽高的元素在指定元素下实现垂直水平居中效果,下面就以span元素为例子,介绍一下如何实现span元素在div中实现水平垂直居中 ...
- js 和 jquery 里面几个获取宽高的调查
罗列下 js 和 jquery 里面获取宽高的方法: obj.offsetWidth = $obj.outerWidth() // offsetWidth obj.clientWidth = obj ...
- js中获取URL中指定的查询字符串
js中获取URL中指定的搜索字符串,主要利用location对象实现,废话少说,上代码. function getSearchString(key) { // 获取URL中?之后的字符 var str ...
随机推荐
- Unable to read the project file 'client.csproj'. Could not load file or assembly 'Microsoft.Build.En
错误具体信息: Unable to read the project file 'client.csproj'. Could not load file or assembly 'Microsoft. ...
- 【cocos2d-x 3.7 飞机大战】 决战南海I (八) 背景移动
採用双层背景.这样效果更好 .h class BackgroundMove : public Layer { public: BackgroundMove(); ~BackgroundMove(); ...
- struts1——静态ActionForm与动态ActionForm
在struts1中,我们能够使用ActionForm来获取从client端提交上来的数据.并通过action配置中的name属性.将某个ActionForm配置到某次请求应答的Action中.作为本次 ...
- [2-SAT] poj 3207 Ikki's Story IV - Panda's Trick
题目链接: id=3207">http://poj.org/problem? id=3207 Ikki's Story IV - Panda's Trick Time Limit: 1 ...
- 【cl】selenium实例一:打开百度,获取第四个标题
/*创建类的时候是TestNG Class*/ package Selenium_lassen; import static org.junit.Assert.*; import java.util. ...
- 0x56 状压DP
gan这两题怎么差不多 #include<cstdio> #include<iostream> #include<cstring> #include<cstd ...
- cxf调用WebService
一.用CXF调用WebService的几种方式,参考: http://cxf.apache.org/docs/how-do-i-develop-a-client.html 二.JaxWsProxyFa ...
- day63-webservice 04.JaxWsServerFactoryBean和SOAP1.2
<wsdl:definitions xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap12="h ...
- 南海区行政审批管理系统接口规范v0.3(规划) 2.业务申报API 2.1.businessApply【业务申报】
{"v_interface":"2015987654327","c_project":"NH09A102"," ...
- 【BZOJ1565】【NOI2009】植物大战僵尸
好久没写博客了 题目 题目在这里 思路&做法 没什么好说的 应该很容易看出是 最大闭合子图 吧? 不过要注意一下的是,这题 可能有植物是不可能被击溃的 , 所以要先跑一遍 拓扑排序 把这些点排 ...