100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > javascript 获取页面的高度及滚动条的位置的代码【javascript】

javascript 获取页面的高度及滚动条的位置的代码【javascript】

时间:2021-01-06 03:40:24

相关推荐

javascript 获取页面的高度及滚动条的位置的代码【javascript】

web前端|js教程

页面高度,滚动条位置

web前端-js教程

qq卡盟 卡盟网站源码下载,装了ubuntu变得卡,快手小程序爬虫,金 php,翁国强seolzw

var Viewport={

top : function(){

return window.pageYOffset

|| document.documentElement && document.documentElement.scrollTop

|| document.body.scrollTop;

},

height : function(){

return window.innerHeight

|| document.documentElement && document.documentElement.clientHeight

|| document.body.clientHeight;

},

left : function(){

return window.pageXOffset

|| document.documentElement && document.documentElement.scrollLeft

|| document.body.scrollLeft;

},

width : function(){

return window.innerWidth

|| document.documentElement && document.documentElement.clientWidth

|| document.body.clientWidth;

},

right : function(){

return Viewport.left() + Viewport.width();

},

bottom : function(){

return Viewport.top() + Viewport.height();

}

};

居中:

贷款单页网站源码,vscode一键排版,ubuntu 界面静止,idea的tomcat窗口,医疗数据爬虫,php mysql选择,陕西seo新手快速入门,响应式网站管理系统源码,织梦软件模型模板lzw

style.position="absolute";

style.left=50%;

style.top=Viewport.Top()+Viewport.Height()/2+"px";

portal 源码,nvme硬盘装ubuntu,爬虫外包接单平台,双轨 php,优化核心seolzw

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