// show a prompt message
// param title : the title to show on the message box
// param msg : the prompt message to tell the user
// param confirmCallback : what happens after the confirm button is clicked
function msgAlert(title, msg, confirmCallback) {
var htmlMsg = "<div style='text-align:center; vertical-align: top; display:none'>";
htmlMsg += "<p style='margin-top: 14px; font-size: 13px'><span>" + msg + "</span></p>";
htmlMsg += "</div>";
$(htmlMsg).dialog({
title: title,
modal: false,
resizable: false,
fixed:false,
width: 300,
height: 180,
position: 'top',
/*show:'blind',*/
hide: 'blind',
open: function(event, ui) {$(this).delay(3000).queue(function() {
if(confirmCallback != null) {
confirmCallback();
}
if($(this).dialog('isOpen')) {
$(this).dialog('close');
}
});},
buttons: {
"关闭": function() {
if(confirmCallback != null) {
confirmCallback();
}
if($(this).dialog('isOpen')) {
$(this).dialog('close');
}
}
}
});
}
// show a confirm message box to user
// param title : the title to show on the message box
// param msg : the confirm message to tell the user
// param confirmCallback : what happens after the confirm button is clicked
function msgConfirm(title, msg, confirmCallback) {
var htmlMsg = "<div style='text-align:center; vertical-align: middle; display:none'>";
htmlMsg += "<p><span>" + msg + "</span></p>";
htmlMsg += "</div>";
$(htmlMsg).dialog({
title: title,
modal: true,
resizable: false,
width: 300,
height: 180,
buttons: {
"确定": function() {
if(confirmCallback != null) {
confirmCallback();
}
$(this).dialog('close');
},
"取消": function() {$(this).dialog('close');}
}
});
}
custom.common.js的msgAlert()
最新推荐文章于 2021-08-09 20:52:07 发布