与你这hide()函数有关,重点检查下这函数;

解决方案 »

  1.   

       if(obj.filters.alpha.opacity<=0)
                 {
                 ClearTimeout(t.timer1);////////clearTimeout是小写
     obj.style.display="none";
      

  2.   

    http://blog.never-online.net/article.asp?id=22
      

  3.   

    function hide(){
    obj = document.all.ly;
    window.status = "hide"+obj.filters.alpha.opacity;
                   
       if(obj.filters.alpha.opacity<0)
    这里如果obj.filters.alpha.opacity<=0,就会出现2次循环,如果是<0就不会。不过也会需要点2次的,在第一次show运行完毕后,状态栏显示为show100而点确定的时候却是hide100,再点一次才开始逐渐的隐藏。为何是这样呢?想不明白
                 {  
                 clearTimeout(t.timer1);
     obj.style.display="none";
     return;
     }
                 else
     {
      obj.filters.alpha.opacity-=2;
      t.timer1=setTimeout("hide()",1)
      return;
              }
                
    }
      

  4.   

    贴出答案,自己解决
    <html>
    <head>
    </head>
    <body>    <script>
    var t=new Object();
    var strdo ="";
    var ishide = false;
    function show(){
        clearTimeout(t);
        obj = document.all.ly;
        obj.style.display="block";
    window.status = "show"+obj.filters.alpha.opacity;
        obj.style.width=document.body.clientWidth;
        obj.style.height=document.body.clientHeight;
     if(obj.filters.alpha.opacity>100){
              clearTimeout(t);
                  obj.filters.alpha.opacity=100;
                  return;
                 }else{
                  obj.filters.alpha.opacity+=2;
                  t=setTimeout("show()",1)
      return;
                 }
                
    }
    function hide(){
    obj = document.all.ly;
    clearTimeout(t);
    window.status = "hide"+obj.filters.alpha.opacity;
       if(obj.filters.alpha.opacity<0)
                 {  
                 clearTimeout(t);
     obj.style.display="none";
     obj.filters.alpha.opacity = 0;
     return;
     }
                 else
     {
                  obj.filters.alpha.opacity-=2;  
      t=setTimeout("hide()",1)
      return;
              }
                
    }function f_add()
    {
      hide();
     }
        </script>    <input type="button" value="显示" onclick="show()">
    <div id="ly" style="position: absolute; top: 0px; filter: alpha(opacity=0); background-color: #f;z-index: 9999; left: 0px; display:block;"><div id="ly2" align="center" style="position: absolute; z-index: 99999;width:expression(document.all.tb_msg.clientWidth);           height:expression(document.all.tb_msg.clientHeight-80);left: expression((document.body.offsetWidth-document.all.tb_msg.offsetWidth)/2);top:expression((document.body.offsetHeight-document.all.tb_msg.offsetHeight)/2);bac kground-color: #fff;"><table width="340" id="tb_msg" border="1" cellpadding="0" cellspacing="0" style="border: 1px solid #e7e3e7;                border-collapse: collapse;"><tr><td style="background-color: #73A2d6; color: #fff; padding-left: 4px; padding-top: 2px;font-weight: bold; font-size: 14px;" height="27" >[数据保存]</td></tr><tr style="padding:4px;height:50px"><td align="center">保存成功</td></tr><tr><td style="background-color: #f7f7f7;" height="30" align="center" ><input type="button" value="新增" onclick="f_add()"/>&nbsp;&nbsp;&nbsp;<input type="button" value="编辑记录" onclick="f_modify()"/>&nbsp;&nbsp;&nbsp;<input type="button" value="退出" onclick="hide()"/></td></tr></table></div></div>
      </body>
    </html>