zoukankan      html  css  js  c++  java
  • div代替window.alert,让这个div显示信息后,在指定之间时间内消失

    <!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=gb2312" />
    <title></title>
    </head>
    <body>
    <div style="padding:2px;background:#06c none repeat scroll 0;position:absolute;z-index:3;color:white;top:1px;right:16px;display:none;" id="div_alert">&nbsp;添加成功…&nbsp;</div> 
    <script type="text/javascript">
    /*想写一个div代替window.alert,让这个div显示信息后,在指定之间时间内消失*/
             
    function aler(elementId,times){
                     
    this.elementId = elementId;
                     
    this.times = times;
                     
    this.show = function(){
                             window.setTimeout(
    this.bbb,1000);
                     }
                     
    this.bbb = function(){
                             document.getElementById(elementId).style.display
    ='';
                             window.setTimeout(
    this.ccc,2000);//就这一句出问题了,请大家帮忙解决
                     }
                     ccc 
    = function(){
                             document.getElementById(elementId).style.display
    ='none';

                     }
             }
             
    var aaa = new aler('div_alert',2000);
             aaa.show();
    </script>
    </body>
    </html>

  • 相关阅读:
    谷歌(google)广告尺寸大小列表
    D盘Program Files 文件夹里文件不显示,没隐藏。怎么才能显示出来?
    请问IOS中做一个手机网站的app壳复杂吗?
    zblog2.X 连不上数据库原因
    二叉查找树的实现与讲解(C++)
    记一次应用异常,处理过程
    C# RSA加密
    js对象 c#对象转换
    C# 微信消息模板 发送
    iis 虚拟目录 文件服务器
  • 原文地址:https://www.cnblogs.com/zkxp/p/1100608.html
Copyright © 2011-2022 走看看