1. 程式人生 > >jQuery+bootstrap實現美化警告/確認/提示對話方塊外掛

jQuery+bootstrap實現美化警告/確認/提示對話方塊外掛

jconfirm.defaults = {
	title:'提示資訊',
    theme:'bootstrap',
    //icon:'fa fa-warning',
    type:'blue',
    typeAnimated:true,
    boxWidth:'30%',
    useBootstrap:false,
    draggable: true
};

/*通用彈出框*/
function alert(content){
	$.alert({content:content});
}

/*通用彈出框的回撥函式*/
function call_alert(content,_callback){
	$.alert({
	    content:content,
	    buttons: {
	        confirm:function () {
	        	_callback(true);
	        }
	    }
	});
}
/*通用確認框的回撥函式*/
function confirm(content,_callback){
	$.confirm({
	    content:content,
	    buttons: {
	    	confirm:function () {
		       _callback(true);
		    },
	        cancel:function () {
		       _callback(false);
	        }
	    }
	});
}