//弹出错误提示的登录框
$.showErr = function(str, func) {
// 调用show方法
BootstrapDialog.show({
type : BootstrapDialog.TYPE_DANGER,
title : '错误 ',
message : str,
size : BootstrapDialog.SIZE_SMALL,//size为小,默认的对话框比较宽
buttons : [ {// 设置关闭按钮
label : '关闭',
action : function(dialogItself) {
dialogItself.close();
}
} ],
// 对话框关闭时带入callback方法
onhide : func
});
};
$.showConfirm = function(str, funcok, funcclose) {
BootstrapDialog.confirm({
title : '确认',
message : str,
type : BootstrapDialog.TYPE_WARNING, // <-- Default value is
// BootstrapDialog.TYPE_PRIMARY
closable : true, // <-- Default value is false,点击对话框以外的页面内容可关闭
draggable : true, // <-- Default value is false,可拖拽
btnCancelLabel : '取消', // <-- Default value is 'Cancel',
btnOKLabel : '确定', // <-- Default value is 'OK',
btnOKClass : 'btn-warning', // <-- If you didn't specify it, dialog type
size : BootstrapDialog.SIZE_SMALL,
// 对话框关闭的时候执行方法
onhide : funcclose,
callback : function(result) {
// 点击确定按钮时,result为true
if (result) {
// 执行方法
funcok.call();
}
}
});
};
$.showSuccessTimeout = function(str, func) {
BootstrapDialog.show({
type : BootstrapDialog.TYPE_SUCCESS,
title : '成功 ',
message : str,
size : BootstrapDialog.SIZE_SMALL,
buttons : [ {
label : '确定',
action : function(dialogItself) {
dialogItself.close();
}
} ],
// 指定时间内可自动关闭
onshown : function(dialogRef) {
setTimeout(function() {
dialogRef.close();
}, YUNM._set.timeout);
},
onhide : func
});
};
<a href="${ctx}/common/showSendMessage" rel="external nofollow" rel="external nofollow" target="dialog">点击打开</a>
$(function() {
// dialogs
if ($.fn.ajaxTodialog) {
$("a[target=dialog]").ajaxTodialog();
}
});
$.fn.extend({
ajaxTodialog : function() {
return this.click(function(event) {
var $this = $(this);
YUNM.debug("ajaxTodialog" + $this.selector);
var title = $this.attr("title") || $this.text();
var url=$this.attr("href");
$.ajax({
type : 'POST',
url : url,
cache : false,
success : function(response) {
ajaxDialog = BootstrapDialog.show({
message : function(dialog) {
var $message = $('<div></div>');
$message.html(response);// 把传回来的页面作为message返回
return $message;
},
title : title,
}
});
event.preventDefault();
return false;
});
},
});
<a href="${ctx}/common/showSendMessage" rel="external nofollow" rel="external nofollow" target="dialog" manipulating="1">自定义页面</a>
if (manipulating == 1) {
ajaxDialog = new BootstrapDialog({
message : function(dialog) {
var $message = $('<div></div>');
$message.html(response);
return $message;
},
// 找到自定义页面上x号进行绑定close事件
onshown : function(dialogRef) {
var $button = dialogRef.getModalContent().find('button[data-widget="remove"]');
$button.on('click', {
dialogRef : dialogRef
}, function(event) {
event.data.dialogRef.close();
});
},
});
ajaxDialog.realize();
ajaxDialog.getModalHeader().hide();// header不要
ajaxDialog.getModalFooter().hide();// footer也不要
ajaxDialog.getModalBody().css('padding', 0);// 无填充
ajaxDialog.open();
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有