<DIV ID=eMeng STYLE="BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX:99999; LEFT: 0px; VISIBILITY: hidden; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: 241px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: 172px; BACKGROUND-COLOR: #c9d3f3">
<A HREF="#" ONCLICK="closeDiv()" style="text-decoration: none; font: bold 12px serif;">X</A>
</DIV>    <SCRIPT LANGUAGE="javascript">
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
//短信提示使用(asilas添加)
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
try{
divTop = parseInt(document.getElementById("eMeng").style.top,10)
divLeft = parseInt(document.getElementById("eMeng").style.left,10)
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
document.getElementById("eMeng").style.visibility="visible"
objTimer = window.setInterval("moveDiv()",10)
}
catch(e){}

 function resizeDiv()
{
i+=1
if(i>1500) closeDiv()
try{
divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
}
catch(e){}
}function moveDiv()
{
try
{
if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
{
window.clearInterval(objTimer)
objTimer = window.setInterval("resizeDiv()",1)
}
divTop = parseInt(document.getElementById("eMeng").style.top,10)
document.getElementById("eMeng").style.top = divTop - 1
}
catch(e){}
}
function closeDiv()
{
document.getElementById('eMeng').style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer)
}
</SCRIPT>
不过要是在浏览器外面出现的话,IE下使用Popup就可以实现了。

解决方案 »

  1.   

    使用createPopup就可以了
    控制好位置就行了
      

  2.   

    回复人: rightyeah(众妙之门) ( ) 信誉:99  2005-05-08 08:22:00  得分: 0  
     
     
       弹出一个页面是没有什么问题的,难度在“推”技术的实现上
      
     
    ===============================================================
    “推”的效果可以用CSSFilter来实现
    FILTER: revealTrans(transition=5,duration=0.5)
      

  3.   

    说得真高深,其实就是pop一个窗口(定义在右下角的位置),向上移动的中心思想
      

  4.   

    To:mingday(小山) 
    什么“推的效果”?我说的是“推”技术,就是指服务器向客户端“推”信息,而不是被动地等待客户端来访问(这是“拉”,是由客户端发起的)
      

  5.   

    <HTML>
    <HEAD>
    <title>提醒信息</title>
    <base target="_blank">
    <SCRIPT language="JavaScript">
        window.resizeTo(220,210);
        var windowW=220  // wide
        var windowH=210  // high    var Yoffset=0   // in pixels, negative values allowed
        var windowStep=2 // move increment (pixels)
        var moveSpeed=12 // move speed (larger is slower)    var Xoffset=25;    var windowX = (screen.width/2)-(windowW/2);
        windowX=screen.availWidth-Xoffset-windowW;
        var windowY = (screen.availHeight);
        var windowYstop = windowY-windowH-Yoffset;
        var windowYnow = windowY;    window.focus ();
        resizeTo(windowW,windowH);
        moveTo(windowX,windowY);    function movePFW() {
             if (document.all) {
                 if (windowYnow>=windowYstop) {
                     moveTo(windowX,windowYnow);
                     //self.focus();
                     windowYnow=windowYnow-windowStep;
                     timer=setTimeout("movePFW()",moveSpeed);
                 } else {
                     clearTimeout(timer);
                     setTimeout("moveBack()",120000 )
                     moveTo(windowX,windowYstop);
                 }
             } else {
                 moveTo(windowX,windowYstop);
             }
        }
        function moveBack() {
             if (document.all){
                 if (windowYnow<=windowY){
                     moveTo(windowX,windowYnow);
                     windowYnow=windowYnow+windowStep;
                     timer1=setTimeout("moveBack()",moveSpeed);
                 } else {
                     clearTimeout(timer1);
                     moveTo(windowX,windowY);
                     self.close()
                 }
             } else {
                 moveTo(windowX,windowYstop);
                 self.close()
             }
        }
    </SCRIPT>
    </HEAD>
    <body bottomMargin="0" bgColor="#ffffcc" leftMargin="5" topMargin="0" onload="movePFW()" rightMargin="0">
    <form name="Form1" method="post" action="this.htm" id="Form1">
      <FONT face="宋体">
            <TABLE id="Table1" style="WIDTH: 180px; HEIGHT: 176px" cellSpacing="0" cellPadding="0" border="0">
              <TBODY>
                <TR>
                  <TD class="td"></TD>
                  <TD class="td"><HR width="100%" color="#006699" SIZE="1"></TD>
                </TR>
                <TR>
                  <TD class="td" vAlign="top" height="100%"></TD>
                  <TD class="td" vAlign="top" height="100%"><span><br>⊙欢迎你第一次使用!</span></TD>
                </TR>
                <TR>
                  <TD width="8"></TD>
                  <TD></TD>
                </TR>
              </TBODY>
            </TABLE>
          </FONT>
        </form>
      </body>
    </HTML>
      

  6.   

    http://www.smallrain.net/js_show.asp?id=789
      

  7.   

    TO rightyeah(众妙之门) 
    “推”不好实现的话,就定时访问服务器去“拉”罗
      

  8.   

    回复人: king2410(什么都不懂) ( ) 信誉:100  2005-05-08 17:12:00  得分: 0  
     
     
       TO rightyeah(众妙之门) 
    “推”不好实现的话,就定时访问服务器去“拉”罗
      
     
    -------------
    没错,我做过几个东西,也是用拉来代替推的。虽然功能是不错的,总觉得不舒服,呵呵
      

  9.   

    毕竟是B/S结构啊,当然如果弄个小控件什么的下到客户端那边去就好弄了,不过这样也就不是严格意义上的B/S了,而且从还要弄安全证书什么的,麻烦,为了感觉舒服一点不值得,除非客户肯加钱,哈哈哈