1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 获取页面高度 窗口高度 滚动条高度等参数值getPageSize getPageScroll【javascript】

获取页面高度 窗口高度 滚动条高度等参数值getPageSize getPageScroll【javascript】

时间:2022-09-21 15:37:35

相关推荐

获取页面高度 窗口高度 滚动条高度等参数值getPageSize getPageScroll【javascript】

web前端|js教程

获取页面高度

web前端-js教程

易语言本地验证源码,vscode 换行 对齐,ubuntu安装软件怎么扩容,tomcat非法关闭,sqlite支持64位,jquery免费日历插件下载,前端框架的设计理念,猫咪眼睛上有爬虫,博客系统php,seo个人简历范文,兼容win7的网站模板,网页框不能居中,个人博客php网站制作模板,后台页面,员工信息管理系统 源代码,三级分销影视程序lzw

function getPageScroll(){

var yScroll;

if (self.pageYOffset) {

yScroll = self.pageYOffset;

} else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict

yScroll = document.documentElement.scrollTop;

} else if (document.body) {// all other Explorers

yScroll = document.body.scrollTop;

}

工作室管理网站源码,ubuntu桌面应用系统,tomcat怎么二个端口,爬虫业绩说明会,php调用一个函数,seo广告排名lzw

arrayPageScroll = new Array(\,yScroll)

return arrayPageScroll;

}

新闻采集asp源码,ubuntu文档复制命令,julia能爬虫吗,php 捕获,鹤壁seo培训lzw

function getPageSize(){

var xScroll, yScroll;

if (window.innerHeight && window.scrollMaxY) {

xScroll = document.body.scrollWidth;

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

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;

}

if(xScroll < windowWidth){

pageWidth = windowWidth;

} else {

pageWidth = xScroll;

}

arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)

return arrayPageSize;

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。