日期:2014-05-18  浏览次数:20664 次

如何在网页有新消息时闪烁Tab式网页
网上有闪烁的例子,但他们只适用于IE6,我想知道在javascript如何编码,以在网页有新消息时闪烁最小化窗口,就像msn有新消息一样的效果。谢谢!!!

------解决方案--------------------
不懂 帮顶
------解决方案--------------------
基于win32的WINDOWS应用好实现,直接调API就可以
网页就不清楚了,有人说用window.focus()不过,我用了后没有闪烁,直接激活成当前的了
------解决方案--------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>Untitled Document</title>
<SCRIPT>

var oPopup = window.createPopup();
var popTop=50;
function popmsg(msgstr){
var winstr="<table style=\"border: 1 solid #000000\" width=\"241\" height=\"172\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"11.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: #ffffff; 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=\"22.gif\" width=\"88\" height=\"61\">welcome-to test");
</SCRIPT>
</head>

<body onLoad="popshow()">
<h1>welcome</h1>
<input type="button" name="but" value="click here" onClick=""/>
</body>
</html>