87,993
社区成员
发帖
与我相关
我的任务
分享layer.msg('删除成功!',
{
time: 2000 //2秒关闭(如果不配置,默认是3秒)
},
function(){
//do something
}); msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",//tip是提示信息,type:'success'是成功信息,'danger'是失败信息,'info'是普通信息
function ShowTip(tip, type) {
var $tip = $('#tip');
// if ($tip.length == 0) {
$tip = $('<div id="tip" style="font-weight:bold;position:fixed;width:350px;top:50px;left:50%;margin-left:-175px;z-index:9999"> <a href="#" class="close" data-dismiss="alert">×</a >'+tip+'</div>');
$('body').append($tip);
//}
$tip.stop(true).attr('class', 'alert alert-' + type).fadeIn(500).delay(2000).fadeOut(500);
}
ShowTip("删除成功!", "success");
window.location.href = "/Article/List";
function ShowTip(options) {
var defaultOptions = {
tip: '默认的消息',
type: '默认的类别',
url: '/default.html',
fadeIn: 500,
fadeOut: 500,
delay: 2000
};
options = $.extend({}, defaultOptions, options);
$('#tip').remove();
var $tip = $('<div id="tip" style="font-weight:bold;position:fixed;width:350px;top:50px;left:50%;margin-left:-175px;z-index:9999"> <a href="#" class="close" data-dismiss="alert">×</a >' + options.tip + '</div>');
$('body').append($tip);
$tip.stop(true).attr('class', 'alert alert-' + options.type)
.fadeIn(options.fadeIn)
.delay(options.delay)
.fadeOut(options.fadeOut, function () {
if (options.url != '')
window.location.href = options.url;
});
}
ShowTip({
tip: 'Some message',
type: 'A',
url: 'www.baidu.com'
});
function ShowTip(tip, type, url) {
var $tip = $('#tip');
// if ($tip.length == 0) {
$tip = $('<div id="tip" style="font-weight:bold;position:fixed;width:350px;top:50px;left:50%;margin-left:-175px;z-index:9999"> <a href="#" class="close" data-dismiss="alert">×</a >'+tip+'</div>');
$('body').append($tip);
//}
$tip.stop(true).attr('class', 'alert alert-' + type).fadeIn(500).delay(2000).fadeOut(500, function(){
if(url){
window.location.href = url;
}
});
}
ShowTip("删除成功!", "success", "/Article/List");
msg.show();
setTimeout(function () {
msg.hide();
localhost.href = 'xxx';
}, 3000);
function ShowTip(tip, type, callback) {
var $tip = $('#tip');
// if ($tip.length == 0) {
$tip = $('<div id="tip" style="font-weight:bold;position:fixed;width:350px;top:50px;left:50%;margin-left:-175px;z-index:9999"> <a href="#" class="close" data-dismiss="alert">×</a >'+tip+'</div>');
$('body').append($tip);
//}
$tip.stop(true).attr('class', 'alert alert-' + type).fadeIn(500).delay(2000).fadeOut(500, callback);
}
ShowTip("删除成功!", "success", function(){
window.location.href = "/Article/List";
});