首页 > 代码库 > artDialog 弹窗提示

artDialog 弹窗提示

artDialog 弹窗提示,方便调用,不用去查文档了。

技术分享
 1 /// <reference path="../../Scripts/artDialog5.0/artDialog.min.js" /> 2  3 ;(function (win) { 4     var artIco = { success: "succeed", sad: "face-sad", error: "error", warning: "warning" }; 5     var artDiv = { 6         loading:LodingDiv, 7         ico: artIco, 8         alertConfirm:function (msg,okFun,cancelFun){ 9             AlertConfirm(msg,okFun,cancelFun);10         },11         alterMessage: function (vImg, vMes, time) {12             if (arguments.length == 2) {13                 AlertMessage(vImg, vMes);14             }else if(arguments.length == 3){15                AlertMessage(vImg, vMes,time);16             }17         }18     };19     20     function LodingDiv(){21             var d = art.dialog({22                 title: 提示,23                 content: "<img src=http://www.mamicode.com/"/Scripts/artDialog5.0/skins/loading.gif\" />",24                 lock: true,25                 opacity: 0.7,26                 esc: false,27                 cancel: false28             });29             return d;30     }31 32     function AlertConfirm(msg,okFun,cancelFun){33            art.dialog({34                 title: 提示,35                 content: msg,36                 lock: true,37                 opacity: 0.7,38                 esc: false,39                 cancel: false,40                 ok:okFun,41                 cancel:cancelFun,42                 okValue: 确定,43                 cancelValue: 取消44             });45     }46 47     function AlertMessage(vImg, vMes) {48         art.dialog({49             title: 信息提示,50             content: <table width=\‘100%\‘><tr><td><img src="http://www.mamicode.com/Scripts/artDialog5.0/skins/icons/ + vImg + .png"/> </td><td> + vMes + </td></tr></table>,51             width: 350px,52             height: 120px,53             opacity: 0.7,54             okValue: 关 闭,55             lock: true,56             ok: function () {57 58             }59         });60     }61 62     function AlertMessage(vImg, vMes, time) {63         art.dialog({64             title: 信息提示,65             content: <table width=\‘100%\‘><tr><td><img src="http://www.mamicode.com/Scripts/artDialog5.0/skins/icons/ + vImg + .png"/> </td><td> + vMes + </td></tr></table>,66             width: 350px,67             height: 120px,68             opacity: 0.7,69             okValue: 关 闭,70             lock: true,71             time: time,72             ok: function () {73 74             }75         });76     }77 78     win.$artDiv = artDiv;79 })(window);
View Code

 

artDialog 弹窗提示