DWZ调整窗口的位置
var url = "${ctx}/pages/CsEarlyDetail/contactInfo.do?csPerson.customerId=${csPerson.customerId}";
var options ={mixable:true,minable:true,resizable:true,drawable:true,max:false,mask:false,width:"900",height:"250",close:doClose()};
$.pdialog.open(url,"detailDialog","详情",options);
//阴影位置显示不对
//$.pdialog.resizeDialog({style: {left: 550, top: 290}}, $.pdialog.getCurrent(), "w");
$.pdialog.resizeDialog({style: {left: 550, top: 290}}, $.pdialog.getCurrent(), "w");
$.pdialog.resizeDialog({style: {left: 550, top: 290}}, $.pdialog.getCurrent(), "n");
DWZ Dialog 源码
/**
* @author Roger Wu
* reference:dwz.drag.js, dwz.dialogDrag.js, dwz.resize.js, dwz.taskBar.js
*/
(function($){
$.pdialog = {
_op:{height:300, width:580, minH:40, minW:50, total:20, max:false, mask:false, resizable:true, drawable:true, maxable:true,minable:true,fresh:true},
_current:null,
_zIndex:42,
getCurrent:function(){
return this._current;
},
reload:function(url, options){
var op = $.extend({data:{}, dialogId:"", callback:null}, options);
var dialog = (op.dialogId && $("body").data(op.dialogId)) || this._current;
if (dialog){
var jDContent = dialog.find(".dialogContent");
jDContent.ajaxUrl({
type:"POST", url:url, data:op.data, callback:function(response){
jDContent.find("[layoutH]").layoutH(jDContent);
$(".pageContent", dialog).width($(dialog).width()-14);
$(":button.close", dialog).click(function(){
$.pdialog.close(dialog);
return false;
});
if ($.isFunction(op.callback)) op.callback(response);
}
});
}
},
//打开一个层
open:function(url, dlgid, title, options) {
var op = $.extend({},$.pdialog._op, options);
var dialog = $("body").data(dlgid);
//重复打开一个层
if(dialog) {
if(dialog.is(":hidden")) {
dialog.show();
}
if(op.fresh || url != $(dialog).data("url")){
dialog.data("url",url);
dialog.find(".dialogHeader").find("h1").html(title);
this.switchDialog(dialog);
var jDContent = dialog.find(".dialogContent");
jDContent.loadUrl(url, {}, function(){
jDContent.find("[layoutH]").layoutH(jDContent);
$(".pageContent", dialog).width($(dialog).width()-14);
$("button.close").click(function(){
$.pdialog.close(dialog);
return false;
});
});
}
} else { //打开一个全新的层
$("body").append(DWZ.frag["dialogFrag"]);
dialog = $(">.dialog:last-child", "body");