<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>Untitled Document</title><style>*{margin:0;padding:0;}#login{Border:1px #000 Solid;position:Absolute;padding:20px}#close{position:Absolute; Right:0;Top:0;}</style><Scriptsrc= "Http://libs.baidu.com/jquery/1.9.0/jquery.js"type= "Text/javascript"></Script><Script>$(function(){ $('#input1'). Click (function(){ varOlogin= $('<div id= "Login" ><p> user name: <input type= "text"/></p><p> Password: <input type= "text"/> </p><div id= "Close" >X</div></div>'); $('Body'). Append (Ologin); Ologin.css (' Left', ($ (window). Width ()-ologin.outerwidth ())/2); Ologin.css ('Top', ($ (window). Height ()-ologin.outerheight ())/2); $('#close'). Click (function() {ologin.remove (); }); $ (window). On ('Resize Scroll',function() {ologin.css (' Left', ($ (window). Width ()-ologin.outerwidth ())/2);Ologin.css ('Top', ($ (window). Height ()-ologin.outerheight ())/2 + $ (window). scrolltop ()); }); }); });</Script></Head><Bodystyle= "height:2000px;"><inputtype= "button"value= "Tap"ID= "INPUT1" /><!--<div id= "Login" > <p> user name: <input type= "text"/></p> <p> password: <input type= "Text"/&G t;</p> <div id= "Close" >X</div></div> -</Body></HTML>
Popup Layer JS let Div center