如何使用JS弹出层
例如我点击一个添加按钮然后弹出一个层让我输入添加的信息弹出后后面的东西是不能动的给我个例子...
例如我点击一个添加按钮 然后弹出一个层 让我输入 添加的信息 弹出后 后面的东西是不能动的 给我个例子
展开
2个回答
2013-08-05
展开全部
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>点击按钮弹出可以移动的层</title>
<script>
function sss(){
table1.style.height=(window.document.body.clientHeight>window.document.body.scrollHeight)?window.document.body.clientHeight:window.document.body.scrollHeight;
table1.style.width="100%";
table1.style.display='block'
table2.style.left=window.document.body.scrollWidth/2-100;
table2.style.top=window.document.body.offsetHeight/2-100
table2.style.display='block'
}function freset(){
document.all.aa.value=document.all.mm.value;
table1.style.display='none'
table2.style.display='none'
}</script>
</script>
</head><body><div id="table1" style=" background:#FFFFFF; display: none; position: absolute;z-index:1;filter:alpha(opacity=40)" oncontextmenu="return false">
</div><div class="table2" id="table2" style="position:absolute; onmousedown=MDown(table2);background:#CCCCCC; display:none; z-index:2; width:300; height:200; border-left:solid #000000 1px; border-top:solid #000000 1px; border-bottom:solid #000000 1px; border-right:solid #000000 1px; cursor:move;" cellspacing="0" cellpadding="0" oncontextmenu="return false">
<input type="text" value="" name = "mm"/>><br>
<input type="button" onClick="freset()" value='确定'> <input type="button" onClick="freset()" value='取消'>
</div>
<center>
<input type="text" value="" name = "aa"/>
<input name="button" type="button" onClick="sss()" value='申请提交'>
</center>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>点击按钮弹出可以移动的层</title>
<script>
function sss(){
table1.style.height=(window.document.body.clientHeight>window.document.body.scrollHeight)?window.document.body.clientHeight:window.document.body.scrollHeight;
table1.style.width="100%";
table1.style.display='block'
table2.style.left=window.document.body.scrollWidth/2-100;
table2.style.top=window.document.body.offsetHeight/2-100
table2.style.display='block'
}function freset(){
document.all.aa.value=document.all.mm.value;
table1.style.display='none'
table2.style.display='none'
}</script>
</script>
</head><body><div id="table1" style=" background:#FFFFFF; display: none; position: absolute;z-index:1;filter:alpha(opacity=40)" oncontextmenu="return false">
</div><div class="table2" id="table2" style="position:absolute; onmousedown=MDown(table2);background:#CCCCCC; display:none; z-index:2; width:300; height:200; border-left:solid #000000 1px; border-top:solid #000000 1px; border-bottom:solid #000000 1px; border-right:solid #000000 1px; cursor:move;" cellspacing="0" cellpadding="0" oncontextmenu="return false">
<input type="text" value="" name = "mm"/>><br>
<input type="button" onClick="freset()" value='确定'> <input type="button" onClick="freset()" value='取消'>
</div>
<center>
<input type="text" value="" name = "aa"/>
<input name="button" type="button" onClick="sss()" value='申请提交'>
</center>
</body>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-08-05
展开全部
把你QQ号码留给我,我发一个实例给你.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询