获得网页内容的有效长度和宽度
来源:互联网 发布:mac的igooffice好用吗 编辑:程序博客网 时间:2024/06/15 08:03
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>获得网页内容的有效长度和宽度</title>
</head>
<script type="text/javascript">
function get_page_size()
{
var re = {};
if (document.documentElement && document.documentElement.clientHeight)
{
//针对IE以外的浏览器
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;
document.write(re.width+"</br>");
document.write(re.height+"</br>");
}
else
{
//针对IE浏览器
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.write(re.width+"</br>");
document.write(re.height+"</br>");
}
return re;
}
</script>
<body>
<input type="button" onclick="get_page_size()" value="click"/>
</body>
</html>
- 获得网页内容的有效长度和宽度
- 获得网页的高度和宽度
- jQuery,javascript获得网页的高度和宽度
- jQuery,javascript获得网页的高度和宽度(转)
- jQuery,javascript获得网页的高度和宽度 .
- jQuery,javascript获得网页的高度和宽度
- jQuery,javascript获得网页的高度和宽度
- jQuery,javascript获得网页的高度和宽度
- jQuery,javascript获得网页的高度和宽度
- jQuery,javascript获得网页的高度和宽度
- jQuery,javascript获得网页的高度和宽度
- [JS]jQuery,javascript获得网页的高度和宽度 【转】
- jQuery,javascript获得网页的高度和宽度
- jQuery,javascript获得网页的高度和宽度
- 获得qstring字符串的长度(字节长度和所占的像素宽度)
- 获得目标网页的内容
- js获得屏幕长度宽度
- 【原创】用JavaScript动态获取网页中缩放图片的长度、宽度和显示比例
- 2009年考研复试
- asp.net中做视频转换,将各种视频文件转换成.flv格式
- Kaffe
- 好用的 Json.NET 3.0 已發佈
- 内存的分配方式
- 获得网页内容的有效长度和宽度
- 高质量c++编程
- mysql 导入数据时内存溢出问题
- RMAN的配置configure
- 8086中的寄存器
- 使用正规表达式编写更好的SQL
- 责任中心(成本中心、利润中心、收入中心、费用中心和投资中心)
- 物理地址与虚拟地址
- 在Fedora9中如何为右键菜单增加打开终端菜单项