.mesWindow {
border: #666 1px solid;
background: #fff;
}
.mesWindowTop {
border-bottom: #eee 1px solid;
margin-left: 4px;
padding: 3px;
font-weight: bold;
text-align: left;
font-size: 12px;
}
.mesWindowContent {
margin: 4px;
font-size: 12px;
}
.mesWindow .close {
height: 15px;
width: 28px;
border: none;
cursor: pointer;
text-decoration: underline;
background: #fff
}
"
+ content + "
";
styleStr = "left:0px;top:25px;position:absolute;";
mesW.style.cssText = styleStr;
document.body.appendChild(mesW);
}
//让背景渐渐变暗
function showBackground(obj, endInt) {
if (isIe) {
obj.filters.alpha.opacity += 1;
if (obj.filters.alpha.opacity setTimeout(function() {
showBackground(obj, endInt)
}, 5);
}
} else {
var al = parseFloat(obj.style.opacity);
al += 0.01;
obj.style.opacity = al;
if (al setTimeout(function() {
showBackground(obj, endInt)
}, 5);
}
}
}
//关闭窗口
function closeWindow() {
if (document.getElementById('back') != null) {
document.getElementById('back').parentNode.removeChild(document
.getElementById('back'));
}
if (document.getElementById('mesWindow') != null) {
document.getElementById('mesWindow').parentNode
.removeChild(document.getElementById('mesWindow'));
}
if (isIe) {
setSelectState('');
}
}
//测试弹出
function testMessageBox(ev) {
var objPos = mousePosition(ev);
messContent = "
";
showMessageBox('', messContent, objPos, 1550);
}
//下面写在body调用上面的方法
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4399/viewspace-2813813/
,如需转载,请注明出处,否则将追究法律责任。