jquery.ui.dialog

//提示框
    var w = width || 300;
    var h = height || 200;
    var alertdiv = $("<div title='提示'></div>").appendTo($("BODY"));
    var content = alertdiv.text(msg);
    alertdiv.dialog({
        autoOpen: true,
        height: h,
        width: w,
        modal: true,
        resizable: false,
        bgiframe: true,
        close: function (evt, ui) {
            alertdiv.dialog("destroy");
            alertdiv.html("").remove();
        },
        buttons:
        {
            "确定": function () {
                if (okClickHanler && $.isFunction(okClickHanler)) {
                    okClickHanler()
                }
                alertdiv.dialog("close");
            }
        }
    });
}
 //确认对话框
function confirmDialog(msg, title, okClickHanler, cancelClickHandler, width, height) {
    var w = width || 300;
    var h = height || 200;
    var confirmdiv = $("<div title='" + (title ? title : "确认") + "'></div>").appendTo($("BODY"));
    var content = confirmdiv.text(msg);
    confirmdiv.dialog({
        autoOpen: true,
        height: h,
        width: w,
        modal: true,
        resizable: false,
        bgiframe: true,
        close: function (evt, ui) {
            confirmdiv.dialog("destroy");
            confirmdiv.html("").remove();
        },
        buttons:
        {
            "确定": function () {
                if (okClickHanler && $.isFunction(okClickHanler)) {
                    okClickHanler()
                }
                confirmdiv.dialog("close");
            },
            "取消": function () {
                if (cancelClickHandler && $.isFunction(cancelClickHandler)) {
                    cancelClickHandler()
                }
                confirmdiv.dialog("close");
            }
        }
    });
}
//用Dialog加载页面
        {
            var div=$("<div id='div_Info' title='信息统计'></div>").appendTo($("BODY"));
            var content=div.load(url,{});
            $("#div_Info").data("url",url);
            div.dialog({
                autoOpen:true,
                width:800,
                height:550,
                modal:true,
                resizable:false,
                bgiframe:true,
                close:function(evt,ui)
                {
                     div.dialog("destroy");
                     div.html("").remove();
                }
            });
        }
posted @ 2012-10-10 23:06  weiwei~  阅读(286)  评论(0编辑  收藏  举报