javascript代码 图片为mid-nei-bg_02.gif
function openAlert(str)
{
str = "常文字的换行(亚洲文字和非亚洲文字)元素拥有默认的white-space:normal,当定义";
var imgUrl = "images/mid-nei-bg_02.gif";
var divAlert = document.createElement("div");
divAlert.id = "openAlert";
divAlert.style.position="absolute";
divAlert.style.width="280px";
divAlert.style.border="1px #CCCCFF solid";
divAlert.style.top="200px";
divAlert.style.left="-140px";
divAlert.style.marginLeft="50%";
divAlert.style.zIndex = "1009";
divAlert.style.backgroundColor = "White";
divAlert.innerHTML = "<div style=\"font-size:smaller;100%;height:26px;line-height:26px;background:url("+imgUrl+");\"> 系统提示框</div>";
divAlert.innerHTML = divAlert.innerHTML + "<div style=\"40px;float:left;background-color:White;\"><img alt='' src='images/alert.png' border='0'/></div>";
divAlert.innerHTML = divAlert.innerHTML + "<div style=\"font-size:smaller;240px;text-align:left;float:left;margin-bottom:10px;background-color:white;\"><br/> "+str+"</div>";
divAlert.innerHTML = divAlert.innerHTML + "<div style=\"100%;text-align:center;margin-bottom:5px;background-color:white;\"><input type='button' value='确定' style=\"background:url("+imgUrl+");border:1px #ccccff solid;40px;height:26px;\" onclick=\"alertOk()\"/></div>";
createShade();
document.body.appendChild(divAlert);
return false;
}
function createShade()
{
var zzDiv = document.createElement("div");
zzDiv.id = "zzDiv";
zzDiv.style.filter='alpha(opacity=10)';
zzDiv.style.backgroundColor = "gray";
zzDiv.style.position="absolute";
zzDiv.style.left="0px";
zzDiv.style.top = "0px";
zzDiv.style.width="100%";
zzDiv.style.height="100%";
zzDiv.style.zIndex = "1008";
zzDiv.style.backgroundColor = "#F3F3F3";
zzDiv.innerHTML = " ";
document.body.appendChild(zzDiv);
}
function alertOk()
{
removeOpenAlert();
}
function removeOpenAlert()
{
window.document.body.removeChild(document.getElementById("openAlert"));
window.document.body.removeChild(document.getElementById("zzDiv"));
}