xiangmu.js
资源名称:moban.rar [点击查看]
上传用户:szraylite
上传日期:2018-06-06
资源大小:11546k
文件大小:1k
源码类别:
软件测试
开发平台:
Java
- var init = function(){
- var xiangmustyle = document.getElementById("xiangmu");
- alert(xiangmustyle);
- xiangmustyle.style.display = "";
- }
- //获取getPageSize
- var getPageSize = function () {
- var de = document.documentElement;
- var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
- var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight
- arrayPageSize = new Array(w,h)
- return arrayPageSize;
- }
- //获取pageScrollTop
- var getPageScroll = function (){
- var yScrolltop;
- var xScrollleft;
- if (self.pageYOffset || self.pageXOffset) {
- yScrolltop = self.pageYOffset;
- xScrollleft = self.pageXOffset;
- } else if (document.documentElement && document.documentElement.scrollTop || document.documentElement.scrollLeft ){ // Explorer 6 Strict
- yScrolltop = document.documentElement.scrollTop;
- xScrollleft = document.documentElement.scrollLeft;
- } else if (document.body) {// all other Explorers
- yScrolltop = document.body.scrollTop;
- xScrollleft = document.body.scrollLeft;
- }
- arrayPageScroll = new Array(xScrollleft,yScrolltop)
- return arrayPageScroll;
- }