<HTML>
<HEAD>
<META http-equiv="content-type" content="text/html; charset=gb2312"/>
<base href="http://dotnet.aspx.cc/">
<LINK href="Images/favicon.ico" rel="Shortcut Icon"/>
<LINK href="Detail.css" type="text/css" rel="stylesheet"/>
</HEAD>
<body>
<div id="eMeng" style="BORDER-RIGHT:#455690 1px solid; BORDER-TOP:#a6b4cf 1px solid; Z-INDEX:99999; LEFT:0px; VISIBILITY:hidden; BORDER-LEFT:#a6b4cf 1px solid; WIDTH:180px; BORDER-BOTTOM:#455690 1px solid; POSITION:absolute; TOP:0px; HEIGHT:116px; BACKGROUND-COLOR:#c9d3f3">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="BORDER-TOP:#ffffff 1px solid; BORDER-LEFT:#ffffff 1px solid"
bgcolor="#cfdef4">
<tr>
<td height="24" width="26" style="FONT-SIZE:12px;BACKGROUND-IMAGE:url(Images/msgTopBg.gif);COLOR:#0f2c8c"
valign="middle"><img src="image/meng.gif" hspace="5" align="absMiddle" vspace="1"/></td>
<td style="FONT-WEIGHT:normal;FONT-SIZE:9pt;BACKGROUND-IMAGE:url(Images/msgTopBg.gif);COLOR:#1f336b;PADDING-TOP:4px"
valign="middle" width="100%">温馨提示:</td>
<td style="BACKGROUND-IMAGE:url(Images/msgTopBg.gif);PADDING-TOP:2px" valign="middle"
width="19" align="right"><img src="Images/msgClose.jpg" hspace="3" style="CURSOR:pointer" onclick="closeDiv()" title="关闭"/></td>
</tr>
<tr>
<td colspan="3" height="90" style="PADDING-RIGHT:1px;BACKGROUND-IMAGE:url(Images/msgBottomBg.jpg);PADDING-BOTTOM:1px">
<div style="BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 13px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 13px; FONT-SIZE: 9pt; PADDING-BOTTOM: 13px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 18px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%">请打开您的音箱收听不同的音乐吧,随机播放。快试试吧!:)<br/>
<div align="center"><a href="#" onclick="window.parent.frames['TopMusic'].location='Play.aspx';return false"
style="FONT-WEIGHT:bold;COLOR:navy">收听全部</a></div>
</div>
</td>
</tr>
</table>
</div><script language="JavaScript" type="text/javascript">
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
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;
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
document.getElementById("eMeng").style.visibility="visible"
objTimer = window.setInterval("moveDiv()",10)
}
catch(e){}
}function resizeDiv()
{
i+=1
if(i>1288) closeDiv()
try{
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
}
catch(e){}
}function moveDiv()
{
try
{
if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
{
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)
}
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){return false}
</script>
</body>
</HTML>

解决方案 »

  1.   

    <script>
    var oPopup = window.createPopup();
    var popTop=50;
    function popmsg(msgstr){
    var winstr="<table style='border: 1 solid  #799ae1' width='240' height='172' border='0' cellpadding='0' cellspacing='0'>"
    winstr+="<tr><td height='30'> </td></tr><tr><td align='center'>"
    winstr+="<table width='90%' height='110' border='0' cellpadding='0' cellspacing='0'>";
    winstr+="<tr><td valign='top' style='font-size:12px; face: Tahoma'>"+msgstr+"</td></tr></table></td></tr></table>";
    oPopup.document.body.innerHTML = winstr;
    popshow();
    }
    function popshow(){
    //window.status=popTop;
    if(popTop>1720){
    clearTimeout(mytime);
    oPopup.hide();
    return;
    }else if(popTop>1520&&popTop<1720){
    oPopup.show(screen.width-250,screen.height,241,1720-popTop);
    }else if(popTop>1500&&popTop<1520){
    oPopup.show(screen.width-250,screen.height+(popTop-1720),241,172);
    }else if(popTop<180){
    oPopup.show(screen.width-250,screen.height,241,popTop);
    }else if(popTop<220){
    oPopup.show(screen.width-250,screen.height-popTop,241,172);
    }
    popTop+=10;
    var mytime=setTimeout("popshow();",50);
    }popmsg("xxxxxxxxxxxxxxxxxxxxxxx")
    </script>
      

  2.   

    Div的位置为:
    body.clintWidth - DivWidth
    body.clintHeight - DivHeight
      

  3.   

    好了,多谢,孟兄果然很强,呵呵,有Msn吗?给一个如何?