我想做一个右下角即时弹窗,数据库有新记录的时候,后台右下角就弹出一个窗口,类似与QQ空间回复的,同时需要有声音提示。请问各位怎么做,最好有例子!!!谢谢。好用可以追加100分!

解决方案 »

  1.   

    http://download.csdn.net/detail/hkafeng/2143770
      

  2.   

    http://download.csdn.net/download/webczw/2770440 这个能用。下面那个有问题
      

  3.   

    用ajax或者server push长连接实现
      

  4.   

     楼主试试下面的的,看是不是你想要的:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <meta name="keywords" content="" />
    <meta name="description" content="www.itrenmin.com" />
    <title>网页特效 点击按钮弹出居中遮罩图层</title>
    <style type="text/css">
    .hidden{display:none;}
    #www_zzjs_net{width:498px; height:100px;padding:4px 10px 10px;background-color:#FFFFFF;border:1px solid #05549d;color:#333333;line-height:24px;text-align:left;-webkit-box-shadow:5px 2px 6px #000;-moz-box-shadow:3px 3px 6px #555;}
    </style>
    <script type="text/javascript">
    //判断浏览器ie6创建的div样式和非ie6创建的div样式
    //创建div
    function showid_zzjs_net(idname){
    var isIE = (document.all) ? true : false;
    var isIE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);
    var newbox=document.getElementById(idname);
    newbox.style.zIndex="9999";
    newbox.style.display="block"
    newbox.style.position = !isIE6 ? "fixed" : "absolute";
    newbox.style.top =newbox.style.left = "50%";
    newbox.style.marginTop = - newbox.offsetHeight / 2 + "px";
    newbox.style.marginLeft = - newbox.offsetWidth / 2 + "px";
    var layer=document.createElement("div");
    layer.id="layer";
    layer.style.width=layer.style.height="100%";
    layer.style.position= !isIE6 ? "fixed" : "absolute";
    layer.style.top=layer.style.left=0;
    layer.style.backgroundColor="#000";
    layer.style.zIndex="9998";
    layer.style.opacity="0.6";
    document.body.appendChild(layer);
    var sel=document.getElementsByTagName("select");
    for(var i=0;i<sel.length;i++){
    sel[i].style.visibility="hidden";
    }
    function layer_iestyle(){
    layer.style.width=Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth)
    + "px";
    layer.style.height= Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) +
    "px";
    }
    function newbox_iestyle(){
    newbox.style.marginTop = document.documentElement.scrollTop - newbox.offsetHeight / 2 + "px";
    newbox.style.marginLeft = document.documentElement.scrollLeft - newbox.offsetWidth / 2 + "px";
    }
    if(isIE){layer.style.filter ="alpha(opacity=60)";}
    if(isIE6){
    layer_iestyle()
    newbox_iestyle();
    window.attachEvent("onscroll",function(){
    newbox_iestyle();
    })
    window.attachEvent("onresize",layer_iestyle)

    layer.onclick=function(){newbox.style.display="none";layer.style.display="none";for(var i=0;i<sel.length;i++){
    sel[i].style.visibility="visible";
    }}
    }
    </script>
    </head>
    <body>
    <a href="http://www.baidu.com/">百度</a>,测试内容<hr>
    <input type="button" id="showbtn" name="showbtn" value="点击显示" onclick="showid_zzjs_net('www_zzjs_net');">
    <div id="www_zzjs_net" style="display:none;">测试内容<br /><br />点击灰色区域遮罩层消失。</div>
    </body>
    </html>
      

  5.   

    支持#4楼。。
    web不是说做不到,而是不适合这样做。还有播放声音,各浏览器支持的音频格式不统一,兼容性也是个障碍。
      

  6.   

    http://www.codefans.net/jscss/code/630.shtml参考下
    <SCRIPT>
    var oPopup = window.createPopup();
    var popTop=50;
    function popmsg(msgstr){
    var winstr="<table style=\"border: 1 solid #6D93C8\" width=\"241\" height=\"172\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" >";
    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 align=\"center\" valign=\"top\" style=\"font-size:12px; color: #6D93C8; 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("这个窗口就是我!");
    </SCRIPT>