`
ld362093642
  • 浏览: 66653 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

custom.common.js的msgAlert()

阅读更多
// 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');}
		}
	});
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics