alert($(window).height()); //浏览器当前窗口可视区域高度
alert($(document).height()); //浏览器当前窗口文档的高度
alert($(document.body).height());//浏览器当前窗口文档body的高度
alert($(document.body).outerHeight(true));//浏览器当前窗口文档body的总高度 包括border padding margin
alert($(window).width()); //浏览器当前窗口可视区域宽度
alert($(document).width());//浏览器当前窗口文档对象宽度
alert($(document.body).width());//浏览器当前窗口文档body的高度
alert($(document.body).outerWidth(true));//浏览器当前窗口文档body的总宽度 包括border padding margin // 获取页面的高度、宽度
function getPageSize() {
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = window.innerWidth + window.scrollMaxX;
yScroll = window.innerHeight + window.scrollMaxY;
} else {
if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
}
var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
if (document.documentElement.clientWidth) {
windowWidth = document.documentElement.clientWidth;
} else {
windowWidth = self.innerWidth;
}
windowHeight = self.innerHeight;
} else {
if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else {
if (document.body) { // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
}
}
// for small pages with total height less then height of the viewport
if (yScroll < windowHeight) {
pageHeight = windowHeight;
} else {
pageHeight = yScroll;
}
// for small pages with total width less then width of the viewport
if (xScroll < windowWidth) {
pageWidth = xScroll;
} else {
pageWidth = windowWidth;
}
arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight);
return arrayPageSize;
} // 滚动条
document.body.scrollTop;
$(document).scrollTop()

最新文章

  1. smarty模块引擎
  2. PHP的CURL方法curl_setopt()函数案例介绍(抓取网页,POST数据)
  3. Redis的事务
  4. Solr JAVA客户端SolrJ 4.9使用示例教程
  5. linux tcp状态学习
  6. 数据结构算法集---C++语言实现
  7. javascript绑定事件
  8. Swift - iOS中各种视图控制器(View Controller)的介绍
  9. .NET Core开发日志——OData
  10. 关于easy ui 的combobox遍历选中
  11. dhtmlxTreeGrid
  12. toggle显示与隐藏切换
  13. 面试题中关于String的常见操作
  14. redis,memcache二者的区别是?(优缺点)
  15. AWS EC2 MySQL迁移到RDS案例
  16. Win10环境下Redis和Redis desktop manager 安装
  17. 搭建RTSP服务器时nginx的nginx.conf文件配置
  18. iad 集成三两事
  19. 【拓展Lucas】模板
  20. C/C++ 笔试题一

热门文章

  1. 硬盘安装centos
  2. Codeblocks支持C++11
  3. UNIX基础知识之信号
  4. RPC框架Thrift例子-PHP调用C++后端程序
  5. 嵌入式Linux开发系列之一: 走进嵌入式Linux的世界
  6. __attribute__机制介绍
  7. (重刷)HDU 1874 畅通工程续 + HDU 2544 最短路 最短路水题,dijkstra解法。
  8. Android 自学之滚动视图ScrollView
  9. DedeCMS更新文章同步发布到新浪微博
  10. P6Spy 、 SQL Profiler