<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> // This must be added because IE8 xhtml4.0 does not support fixed if the height of the first layer exceeds the browser height, that is, imgdiv with a scroll bar, does not scroll with the scroll bar, it is always there <body id = "gn"> </body> <script language = "JavaScript"> function $ (titlename) {return document. createelement (titlename);} function $ (e) {return document. getelementbyid (E);} var lodingbox =$ $ ("Div"); lodingbox. style. position = "fixed"; lodingbox. style. width = screen. width + "PX"; lodingbox. style. height = screen. height + "PX"; lodingbox. style. backgroundcolor = "# cccccc"; lodingbox. id = "lodingbox"; var imgdiv =$ $ ("Div"); var imgdiv_width = "300"; var imgdiv_height = "100"; var imfdiv_left = screen. width-screen.width/2-imgdiv_width/2; // Why subtract 100px // I also don't know why it's calculated above high bottom low so I subtract 100 pxvar imfdiv_height = screen. height-screen.height/2-imgdiv_height/2-100; imgdiv. style. position = "fixed"; imgdiv. style. left = imfdiv_left + "PX"; imgdiv. style. top = imfdiv_height + "PX"; imgdiv. style. width = imgdiv_width + "PX"; imgdiv. style. height = imgdiv_height + "PX"; imgdiv. style. backgroundcolor = "red"; imgdiv. id = "imgdiv"; var lodingimg =$ $ ("IMG"); lodingimg. src = "loadingmin.gif"; var lodingtext =$ $ ("span"); lodingtext. innerhtml = "saving data. Please wait .... "; imgdiv. appendchild (lodingimg); imgdiv. appendchild (lodingtext); $ ("gn "). appendchild (lodingbox); $ ("gn "). appendchild (imgdiv); var temp = 1; zheli (10); // $ ("lodingbox "). style. display = "NONE"; // $ ("imgdiv "). style. display = "NONE"; function zheli (n) {If (n = 1) {return temp;} temp = temp * n; // document. write (temp + "<br/>"); // recursive zheli (n-1) ;}</SCRIPT>