CopyCode The 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;
}