仿MSN的短消息提示<BR>一、修改“当前主模板”——“界面风格”——Dvbbs.mainhtml(12)<BR><bgsound src="skins/default/mail.wav" border=0>||<script language="JavaScript">openScript("messanger.asp?action=read&id=
{$smsid}&sender={$sender}",500,400)</script>||<img src="skins/default/msg_new_bar.gif" align="absmiddle"> <a
href="usersms.asp?action=inbox">我的收件箱</a> (<a href="<B>javascript</B> penScript('messanger.asp?action=read&id={$smsid}
&sender={$sender}',500,400)"><font color={$alertcolor}>{$newmsgnum}</font></a>)<script language="JavaScript">window.onload = getMsg;<BR>window.onresize = resizeDiv;window.onerror = function(){}</script><DIV id=eMeng <BR>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"><BR> <TABLE style="BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid" cellSpacing=0 cellPadding=0 width="100%"
bgColor=#cfdef4 border=0><BR> <TBODY><BR> <TR><BR> <TD style="FONT-SIZE: 12px; BACKGROUND-IMAGE: url(z_plus/msgboximages/msgTopBg.gif); COLOR: #0f2c8c"
vAlign=center width=30 height=24></TD><BR> <TD style="FONT-WEIGHT: normal; FONT-SIZE: 9pt; BACKGROUND-IMAGE: url(z_plus/msgboximages/msgTopBg.gif);
COLOR: #1f336b; PADDING-TOP: 4px" vAlign=center width="100%"> 短消息提示:</TD><BR> <TD style="BACKGROUND-IMAGE: url(z_plus/msgboximages/msgTopBg.gif); PADDING-TOP: 2px" vAlign=center
align=right width=19><IMG title=关闭 style="CURSOR: hand" onclick=closeDiv() hspace=3 src="z_plus/msgboximages/msgClose.jpg"></TD><BR> </TR><BR> <TR><BR> <TD style="ADDING-RIGHT: 1px; BACKGROUND-IMAGE: url(z_plus/msgboximages/msgBottomBg.jpg); PADDING-BOTTOM:
1px" colSpan=3 height=90><BR> <DIV <BR> 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%">您有<a href="<B>javascript</B> penScript('messanger.asp?
action=read&id={$smsid}&sender={$sender}',500,400)"><font color={$alertcolor}>{$newmsgnum}</font></a>封新短消息 <BR><BR><BR><BR> <DIV align=center style="word-break:break-all"><a href="<B>javascript</B> penScript
('messanger.asp?action=read&id={$smsid}&sender={$sender}',500,400)"><font color={$alertcolor}>查看{$sender}给您的短信
</font></a></DIV>
</DIV><BR> </TD><BR> </TR><BR> </TBODY><BR> </TABLE><BR></DIV>||<img src="skins/default/msg_no_new_bar.gif" align="absmiddle"> <a href="usersms.asp?action=inbox">我的收件箱</a>
(<font color=gray>0</font>)
二、在main.js后添加:
//短信提示使用(asilas添加)<BR>var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;<BR>function getMsg()<BR>{<BR> try{<BR> divTop = parseInt(document.getElementById("eMeng").style.top,10)<BR> divLeft = parseInt(document.getElementById("eMeng").style.left,10)<BR> divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)<BR> divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)<BR> docWidth = document.body.clientWidth;<BR> docHeight = document.body.clientHeight;<BR> document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight<BR> document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth<BR> document.getElementById("eMeng").style.visibility="visible"<BR> objTimer = window.setInterval("moveDiv()",10)<BR> }<BR> catch(e){}<BR>}
function resizeDiv()<BR>{<BR> i+=1<BR> if(i>500) closeDiv()<BR> try{<BR> divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)<BR> divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)<BR> docWidth = document.body.clientWidth;<BR> docHeight = document.body.clientHeight;<BR> document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)<BR> document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)<BR> }<BR> catch(e){}<BR>}
function moveDiv()<BR>{<BR> try<BR> {<BR> if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))<BR> {<BR> window.clearInterval(objTimer)<BR> objTimer = window.setInterval("resizeDiv()",1)<BR> }<BR> divTop = parseInt(document.getElementById("eMeng").style.top,10)<BR> document.getElementById("eMeng").style.top = divTop - 1<BR> }<BR> catch(e){}<BR>}<BR>function closeDiv()<BR>{<BR> document.getElementById('eMeng').style.visibility='hidden';<BR> if(objTimer) window.clearInterval(objTimer)<BR>}<BR>//短信提示使用(asilas添加结束)
三、将图片放到相应位置
|