function showWindow(url,obj,callBack,arguments){ if(obj==undefined||obj==null||obj==''){ obj={}; obj.isDialog=1; } //url=encodeURL(url); var param = {"url":url,vArguments:obj,dialogWidth:(screen.availWidth - 60),dialogHeight:(screen.availHeight - 110),callBack:callBack}; param=$.extend(param,arguments||{}); var openPage=new myapp(param)//new 一个打开对象 **改变了窗体不是默认大小 openPage.openNewWin(); } /********************************************/ Object.extend = function(destination, source) { for (var property in source) { destination[property] = source[property]; } return destination; } var myapp=function(o){ this.options={ url:"",//你要打开的页面url vArguments:"window",//你要向打开的页面传递的数据 dialogWidth:500,//打开窗口的宽度 dialogHeight:500,//你打开窗口的高度 center:"yes",//center: {yes | no | 1 | 0 }:窗口是否居中,默认yes,但仍可以指定高度和宽度。 help:"no",// {yes | no | 1 | 0 }:是否显示帮助按钮,默认yes resizable: "yes",//{yes | no | 1 | 0 } [IE5+]:是否可被改变大小。默认no status: "yes",//{yes | no | 1 | 0 } [IE5+]:是否显示状态栏。默认为yes[ Modeless]或no[Modal]。 scroll:"yes",//{ yes | no | 1 | 0 | on | off }:指明对话框是否显示滚动条。默认为yes。 callBack:false }; Object.extend(this.options, o || {}); } myapp.prototype={ openNewWin:function(url){ var options=this.options; var l=(screen.availWidth-options["dialogWidth"])/2; var h=(screen.availHeight-options["dialogHeight"])/2; var sp="dialogTop:"+h+"px;dialogLeft:"+l+"px;dialogWidth:"+options["dialogWidth"]+"px;dialogHeight:"+options["dialogHeight"]+"px;center:"+options["center"]+";help:"+options["help"]+";resizable:"+options["resizable"]+";status:"+options["status"]+";scroll:"+options["scroll"]; var newWin=window.showModalDialog(options["url"],options["vArguments"],sp); var call = options["callBack"]; if(typeof call=="function"){//调用 数据处理函数 call(newWin); } }, setOptions:function(){ } } /******************************************************************/