showModalDialog窗口居中

阅读更多
设置iTop和iLeft属性,如下:


	function openTempleteSelector(url,iWidth,iHeight){ 
	var iTop = (window.screen.availHeight - 20 - iHeight) / 2;
        var iLeft = (window.screen.availWidth - 10 - iWidth) / 2;
		window.showModalDialog(url,window,"dialogWidth:"+iWidth+"px;dialogHeight:"+iHeight+"px;dialogTop:"+iTop+"px;dialogLeft:"+iLeft+"px;edge: Raised; center: Yes; help: No; resizable: Yes; status: No;");	
		onCharsChange();
	} 

你可能感兴趣的:(showModalDialog,窗口居中)