Copy codeThe Code is as follows:
Function getPageScroll (){
Var yScroll;
If (self. pageYOffset ){
YScroll = self. pageYOffset;
} Else if (document.doc umentElement & document.doc umentElement. scrollTop) {// Explorer 6 Strict
YScroll = document.doc umentElement. scrollTop;
} Else if (document. body) {// all other referers
YScroll = document. body. scrollTop;
}
ArrayPageScroll = new Array ('', yScroll)
Return arrayPageScroll;
}
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... wocould also work in Explorer 6 Strict, Mozilla and Safari
XScroll = document. body. offsetWidth;
YScroll = document. body. offsetHeight;
}
Var implements wwidth, implements wheight;
If (self. innerHeight) {// all privileges t Explorer
Required wwidth = self. innerWidth;
Optional wheight = self. innerHeight;
} Else if (document.doc umentElement & document.doc umentElement. clientHeight) {// Explorer 6 Strict Mode
Required wwidth = document.doc umentElement. clientWidth;
Required wheight = document.doc umentElement. clientHeight;
} Else if (document. body) {// other Explorers
Required wwidth = document. body. clientWidth;
Optional wheight = document. body. clientHeight;
}
// For small pages with total height less then height of the viewport
If (yScroll <windowHeight ){
PageHeight = running wheight;
} Else {
PageHeight = yScroll;
}
If (xScroll <1_wwidth ){
PageWidth = required wwidth;
} Else {
PageWidth = xScroll;
}
ArrayPageSize = new Array (pageWidth, pageHeight, expires wwidth, expires wheight)
Return arrayPageSize;
}