简简单单,让JQuery Dialog 最大化,最小化
闲话不说,
看代码:
样式表:
p.ui-xlgwr .ui-icon{ position:relative; float: left; margin:0.4em 0.5em 0 0.5em; cursor: pointer; z-index:999;}
p.ui-xlgwr{ position:absolute; top:-10px; padding:0; right:0; display:inline;}
代码:
$("#dialog_tools,#dialog_Create").dialog({
autoOpen: false,
zIndex: 3999,
width: 680,
height: 600,
buttons: {
" 确 定 ": function () {
// var id = $(this).find('input:checked').attr("value");
// alert(id.toString());
$(this).dialog("close");
//location.href = "/GldOne/ProductionSchedule/CreateProcessInspection";
location = location;
//window.location.reload();
// location.reload();
},
" 取 消 ": function () {
$(this).dialog("close");
}
},
open: function (event, ui) {
var $dialog = $(this);
var atext = $(".ui-dialog-titlebar-close").replaceWith('<p class="ui-xlgwr"><span class="ui-icon ui-icon-minusthick">minusthick</span> <span class="ui-icon ui-icon-extlink">extlink</span><span class="ui-icon ui-icon-closethick">close</span></p>');
$(".ui-xlgwr>span").click(function () {
var spantext = $(this).text();
//alert("ok:ui-span" + spantext);
if (spantext == "extlink") {
if (window.screen) { //判断浏览器是否支持window.screen判断浏览器是否支持screen
var myw = screen.availWidth; //定义一个myw,接受到当前全屏的宽
var myh = screen.availHeight; //定义一个myw,接受到当前全屏的高
//window.moveTo(0, 0); //把window放在左上脚
//window.resizeTo(myw, myh); //把当前窗体的长宽跳转为myw和myh
$dialog.dialog({
position: ['left', 'top'],
width: myw * 0.8,
height: myh * 0.8
});
} else {
$dialog.dialog({
position: 'center',
width: 800,
height: 600
});
}
} else if (spantext == "minusthick") {
$dialog.dialog({
position: 'top',
width: 210,
height: 210
});
} else if (spantext == "close") {
$dialog.dialog("close");
} else {
alert("请选择正确的图标,谢谢.");
}
});
},
close: function () {
//$("#dialogtools").text("加载中...");
$(".loadmessage").hide();
}
});
效果图: