答案:<!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=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function ShopConfirm(str){
var ShopConfirmLayer=document.getElementById(str);
var webBgLayer=document.getElementById("webBgLayer");
// ShopConfirmLayer.innerHTML=str;
ShopConfirmLayer.style.display="";//显示内容层,显示覆盖层
ShopConfirmLayer.style.left=parseInt((document.documentElement.scrollWidth-ShopConfirmLayer.offsetWidth)/2)+document.documentElement.scrollLeft+"px";
ShopConfirmLayer.style.top=Math.abs(parseInt((document.documentElement.clientHeight-ShopConfirmLayer.offsetHeight)/2))+document.documentElement.scrollTop+"px"; //为内容层设置位置
webBgLayer.style.display="";
webBgLayer.style.height=document.documentElement.scrollHeight+"px"; //为覆盖层设置高度
}
function CloseShopConfirm(ids){
var ShopConfirmLayer=document.getElementById(ids);
var webBgLayer=document.getElementById("webBgLayer");
ShopConfirmLayer.style.display="none";
webBgLayer.style.display="none";
}
function hide(id)
{
var ids=document.getElementById(id);
ids.style.display='none';
}
</script>
</head>
<body style=" height:95%;">
<input type="button" value="test" onclick="ShopConfirm('img3')" />
<div id="img3" style="position:absolute;top:343px;left:129px; background:#F7ECF9; font-size:14px; color:black;z-index:900; border:2px #FFCC00 solid; width:350px; height:220px; padding:9px;">
<div style="width:350px; text-align:right;"><div style=" color:#9900CC; font-weight:bold; font-size:15px; cursor:hand;" onclick="CloseShopConfirm('img3')">关 闭</div></div>
<br/><br/><br/><br/><br/> 在这里设置注册按钮
</div>
</div><script language="javascript">hide('img3');</script>
<div id="webBgLayer" style="position:absolute;top:0px;left:0px;z-index:899;background-color:black;height:100%;width:100%;display:none;-moz-opacity:0.9;filter:alpha(opacity=50);"></div>
</body>
</html>
专门帮你做的,记得给分哈。
其他:window.open()..........
上一个:js检测用户名是否已注册,jsp和js代码怎么写,我知道要用AJAX,但麻烦给出具体代码,我人比较笨。
下一个:那位大神帮帮我! 求注释!!!JSP代码。。。