模仿QQ与MSN消息提示效果

有好多人问我类似于MSN的Web短信提示消息是怎么做的,今天偶尔在网上遇到了一段关于此的代码,可能不是太好,不过要自己动手再加以修饰,相信会做出更好的效果来,代码粘贴如下:
<SCRIPT>
var oPopup = window.createPopup();
var popTop=50;
function popmsg(msgstr){
var winstr="<table style=\"border: 1 solid  #FFA6CA\"  width=\"241\" height=\"172\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  background=\"http://www.blueidea.com/articleimg/2004/01/1576/04-s.jpg\" >";
winstr+="<tr><td height=\"30\"> </td></tr><tr><td align=\"center\"><table width=\"90%\" height=\"110\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
winstr+="<tr><td valign=\"top\" style=\"font-size:12px; color: red; 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("    <img border=\"0\" src=\"http://www.blueidea.com/img/common/logo.gif\" width=\"90\" height=\"27\">欢迎光临蓝色理想,大量的设计资源等着你!有什么问题可以到经典论坛提出。");
</SCRIPT>
posted @ 2006-03-30 08:46  bigwhiteshark(云飞扬)  阅读(617)  评论(0编辑  收藏  举报