📄 msnpopup.js
字号:
/*------------------- msn popup function -------------------*/
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,objMove= 0;
function getMsg() {
try {
divTop = parseInt(document.getElementById("epop").style.top,10)
divLeft = parseInt(document.getElementById("epop").style.left,10)
divHeight = parseInt(document.getElementById("epop").offsetHeight,10)
divWidth = parseInt(document.getElementById("epop").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("epop").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
document.getElementById("epop").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
document.getElementById("epop").style.visibility="visible"
objTimer = window.setInterval("moveDiv()",10)
}
catch(e){}
}
//move up
function moveDiv() {
try {
if(parseInt(document.getElementById("epop").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10))) {
clearTimer();
stopTimer();
}
divTop = parseInt(document.getElementById("epop").style.top,10)
document.getElementById("epop").style.top = divTop - 5
}
catch(e){}
}
//move down
function resizeDiv() {
try {
if(parseInt(document.getElementById("epop").style.top,10) >= (parseInt(document.body.scrollTop,10) + docHeight - 20)) {
//finished
closeDiv();
}
else {
divTop = parseInt(document.getElementById("epop").style.top,10);
document.getElementById("epop").style.top = divTop + 10;
}
}
catch(e){}
}
function clearTimer() {
if(objTimer) window.clearInterval(objTimer);
}
function startTimer() {
objTimer = window.setInterval("resizeDiv()",10);
}
function stopTimer() {
window.setTimeout("startTimer()",10000);//stop 10s
startFixup();//fixup
}
function closeDiv() {
clearTimer();
clearFixup();
document.getElementById("epop").style.visibility="hidden";
}
function startFixup() {
document.getElementById("epop").style.top=docHeight - divHeight + document.body.scrollTop;
objMove=window.setTimeout("startFixup();",200);
}
function clearFixup() {
if(objMove) window.clearTimeout(objMove);
}
/**
function hiddenDiv() {
var epop = document.getElementById("epop");
//alert( epop.filters.alpha.Opacity );
//if( epop.filters.alpha.Opacity > 0) {
// epop.filters.alpha.Opacity -= 1;
//}
//else{
// closeDiv()
//}
closeDiv();
}
**/
/*-------------- main: show the msn popup message ----------------*/
if(true) {
var popup = document.getElementById("epop")
popup.innerHTML = ' <table width=200 border="0" cellspacing="0" cellpadding="0" bgcolor="#E0E9F8" onmouseover="clearTimer()" onmouseout="startTimer()"> <tr> <td width="160" height="24" valign="middle" style="filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=, StartColorStr=#E0E9F8, EndColorStr=#FFFFFF);font:12px;color:#1F336B;"> \u63d0 \u793a: </td><td valign="middle" align="right" style="filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=, StartColorStr=#E0E9F8, EndColorStr=#FFFFFF);"> <span style="cursor:pointer;color:#728EB8; font:bold 13px;" onclick="closeDiv()" onmouseover="style.color=\'#455690\';" onmouseout="style.color=\'#728EB8\';">X</span> </td></tr> <tr> <td colspan=2 style="border-left:1px solid #728EB8; border-top:1px solid #728EB8; border-bottom:1px solid #B9C9EF; border-right:1px solid #B9C9EF; background:#E0E9F8; padding:10px; overflow:hidden; text-align:center; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=\'#E0E9F8\', EndColorStr=\'#FFFFFF\');font:12px;color:#1F336B;line-height: 20px;"><bgsound src=lybbs/images/mail.wav border=0>\u60a8\u6709 <FONT color=#ff0000>'+newMsgNumber+'</FONT> \u4e2a\u65b0\u7684\u77ed\u6d88\u606f\u3002<br> <a style="color:#1F336B;" href="bbs_messageInbox.do">\u5728\u5f53\u524d\u7a97\u53e3\u9605\u8bfb</a> <a style="color:#1F336B;" href="javascript:openScript(\'bbs_messageInbox.do\',550,400)">\u5f00\u65b0\u7a97\u53e3\u9605\u8bfb</a><br> <a style="color:#1F336B;" href="bbs_userControlPanel.do?action=mySet">\u70b9\u51fb\u8fd9\u91cc\u8bbe\u7f6e\u77ed\u6d88\u606f\u6a21\u5f0f</a> </td></tr> </table>';
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
}else{
// else do nothing
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -