Jquery--弹窗

时间:2023-03-09 21:36:02
Jquery--弹窗
<title>弹窗</title>

    <script src="JS/jquery-1.7.2.js"></script>
<style type="text/css">
#tanchuang {
position:fixed;/*固定住窗口*/
top:100px;
width:%;
height:300px;
top:-1000px;
left:%;
overflow:hidden;
z-index:;/*弹窗比遮罩要高*/
}
#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:%;
left:%;
top:%;
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:#;
left:%;
top:5px;
text-align:center;
color:white;
line-height:30px;
cursor:pointer;
}
#zhezhao {
position:fixed;
width:%;
height:%;
background-color:black;
z-index:;
opacity:0.4;
display:none;
}
</style>
 <input  type="text" id="biaoti"/><br />
<input type="text" id="neirong"/>
<!--弹窗开始-->
<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">确定</div>
</div>
</div>
<input type="button" value="弹窗"id="tc" />
<!--弹窗结束-->
</form>
</body>
</html>
<script src="JS/tanchuang.js"></script>
<script type="text/javascript">
$("#tc").click(function () {
tc("标题","内容");
}); </script>
function tc(a, b) {//做成方法,可调用
$("#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();
});//点击确定弹走
});