堕落的卖猪贩-做人就象做诗,一旦上了境界,就下不来了。

我的Ber客我作主,今天你Ber没有。

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
<!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>

posted on 2008-03-11 15:17  堕落的卖猪贩  阅读(1229)  评论(3编辑  收藏  举报