<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "
<html xmlns= "http://www.w3.org/1999/xhtml" > <head> <meta http-equiv= "Content-type" content= "text/" html Charset=utf-8 "/> <title> window </title> <style type=" Text/css "> body{margin:0;padding:0;} #bg { Background: #000;p osition:absolute;left:0;top:0;filter: "Alpha (opacity=20)"; opacity:0.2;display:none;} #win {width:200px;height:200px;position:absolute;left:50%;top:50%;margin:-100px-100px 0;border:4px #F00 solid; Background: #FFF;d isplay:none;} </style> </head> <body> <a href= "javascript:;" onclick= "Wintip ()" > Popup </a> <div id= "BG" ></div> <div id= "Win" ><a href= "javascript:;" onclick= "Wintip ()" > Close </a></div > </body> <script type= "Application/javascript" > var $=function (id) {return document.getElementById (ID );} function Wintip () {var win=new winsize (); var tip=$ ("BG"); Tip.style.width=win. w+ "px"; Tip.style.height=win. h+ "px"; if (tip.style.display== "block") {tip.style.display= "none"; $ ("WIn "). style.display=" None "; }else{tip.style.display= "Block", $ ("Win"). style.display= "Block";} function winsize ()//functions: Get dimension {var winwidth = 0; var winheight = 0; if (window.innerwidth) winwidth = window.innerwidth; E LSE if ((Document.body) && (document.body.clientWidth)) winwidth = Document.body.clientWidth; if (window.innerheight) winheight = window.innerheight; else if ((document.body) && (document.body.clientHeight)) winheight = Document.body.clientHeight; if (document.documentelement && document.documentElement.clientHeight && Document.documentElement.clientWidth) {winheight = document.documentElement.clientHeight; winwidth = Document.documentElement.clientWidth;} return{"W": Winwidth, "H": Winheight}} </script> </html></td> </tr> </table>