easyUI实现(alert)提示框自动关闭的实例代码

function alert_autoClose(title,msg,icon){
 var interval;
 var time=1000;
 var x=2;  //设置时间2s
$.messager.alert(title,msg,icon,function(){});
 interval=setInterval(fun,time);
    function fun(){
   --x;
   if(x==0){
     clearInterval(interval);
 $(".messager-body").window('close'); 
    }
};
}
 
easyui messager alert 的参数可以参考
http://xiaoyaocao.iteye.com/blog/1880245
 
原文地址:https://www.cnblogs.com/sjqq/p/6361074.html