网页右下角弹出层

<DIV id=eMeng style="Z-INDEX: 99999; LEFT: 1142px; VISIBILITY:hidden;WIDTH: 168px;POSITION: absolute; TOP: 754px; HEIGHT: 115px; ">
<div>
网页右下角弹出层</div>
<div class="closebox">
<a href="javascript:void(0)" onclick="closeDiv()" title="关闭" style="color:white;">×</a>
</div>
</DIV>




<SCRIPT language=JavaScript>
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
var app=navigator.appName;
var verStr=navigator.appVersion;
function getMsg()
{
try{ 
divTop = parseInt(document.getElementById("eMeng").style.top,10)
divLeft = parseInt(document.getElementById("eMeng").style.left,10)
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
if(app.indexOf('Microsoft') != -1){
document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth;
}
else{
document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;
document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth-39;
}
document.getElementById("eMeng").style.visibility="visible";
objTimer = window.setInterval("moveDiv()",1);
}
catch(e){}
}

function resizeDiv()
{
try{
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
if(app.indexOf('Microsoft') != -1){
document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10);
document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10);
}else{
if(parseInt(document.body.scrollTop,10)<=246){
document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)-49;
document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)-39;
}
}
}
catch(e){}
}

function moveDiv()
{
try
{
var height;
if(app.indexOf('Microsoft') != -1){
height=docHeight - divHeight + parseInt(document.body.scrollTop,10)
}else{
height=docHeight - divHeight + parseInt(document.body.scrollTop,10)-45;
}
if(parseInt(document.getElementById("eMeng").style.top,10) <= height)
{
window.clearInterval(objTimer);
objTimer = window.setInterval("resizeDiv()",1);
}
divTop = parseInt(document.getElementById("eMeng").style.top,10);
document.getElementById("eMeng").style.top = divTop - 1;

}
catch(e){}
}
function closeDiv()
{
document.getElementById('eMeng').style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer);
}
</SCRIPT>

你可能感兴趣的:(Microsoft)