<title> pop-up </title> <script src="Js/jquery-1.7.2.js"></script> <style type="Text/css">#tanchuang {position:fixed;/*Fixed window*/top:100px; Width: -%; height:300px; Top:-1000px; Left: *%; Overflow:hidden; Z-index:100001;/*The pop window is taller than the mask .*/} #tc_top {position:relative; Width: -%; height:40px; Background-color: #0026ff; Color:white; Text-Align:center; Line-height:40px; } #tc_main {position:relative; Width: -%; height:220px; Background-color: #0ff; } #tc_maintext {position:relative; Width: -%; Height: the%; Left: the%; Top:Ten%; Background-Color:orange; Text-Align:center; } #tc_bottom {position:relative; Width: -%; height:40px; Background-color: #0026ff; } #tc_btnok {position:relative; Width: -%; height:30px; Background-color:#808080; Left: *%; top:5px; Text-Align:center; Color:white; Line-height:30px; Cursor:pointer; } #zhezhao {position:fixed; Width: -%; Height: -%; Background-Color:black; Z-index:100000; Opacity:0.4; Display:none; } </style>
View Code
<input type="text"Id="Biaoti"/><br/> <input type="text"Id="Neirong"/> <!--pop-up window starts--<div id="Zhezhao"></div> <div id="Tanchuang"> <div id="Tc_top"></div> <div id="Tc_main"> <div id="Tc_maintext"></div> </div> <div id="Tc_bottom"> <div id="Tc_btnok"> OK </div> </div> </div> <input type="Button"Value="pop -up window"Id="TC"/> <!--pop-up window ends--</form></body>"Js/tanchuang.js"></script><script type="Text/javascript"> $("#tc"). Click (function () {TC ("title","content"); }); </script>
Function TC (A, b) {//the method can be called$("#zhezhao"). Show (); $("#tanchuang"). Animate ({top:" -"}, -). Animate ({top:" -"}, $). Animate ({top:" -"}, $); $("#tc_top"). text (a); $("#tc_maintext"). Text (b);}; $("#tc_btnok"). Click (function () {$ ("#tanchuang"). Animate ({top:"-2000"}, -, Function () {$ ("#zhezhao"). Hide (); });//Click OK to bounce away});
jquery--Pop-up window