/* ========================================================================== 功能:讓 window.open 指定大小能完全正確 (包含 a Tag 的 target=_blank) 目前支援 IE 4.0 以上,NetScape 6.0 以上 使用方式:Include 下面程式至 Body Tag 中間 作者:Jason 建立日期:2002/5/28 修改日期:2002/5/28 特殊註記:[TempCode][/TempCode]、[TestMode][/TestMode] ========================================================================== */ function ChangeBrowserSize(iWinWidth, iWinHeight) { var iReSizeWidth, iReSizeHeight; var iBarHeight; var isIE; iReSizeWidth = iWinWidth; iReSizeHeight = iWinHeight; thisWin = this.window; thisWin.resizeTo(iWinWidth, iWinHeight); isIE = (document.all)? true:false; if (isIE == true) { //IE iReSizeWidth = iWinWidth; iReSizeHeight = iWinHeight; if ((iWinHeight - document.body.scrollHeight) > 25) { iBarHeight = iWinHeight - document.body.scrollHeight; if (iBarHeight > 25) {iReSizeWidth += 12;} else {iReSizeWidth += 10;} if (iWinWidth <= 50) {iReSizeWidth += (50 - iWinWidth);} if (iWinHeight <= 120) {iReSizeHeight += iBarHeight + 12 + (120 - iWinHeight);} else {iReSizeHeight += iBarHeight;} } thisWin.resizeTo(iReSizeWidth, iReSizeHeight); } else { //NetScape if (self.menubar.visible == true) { thisWin.resizeTo(iWinWidth,iWinHeight); self.scrollbars.visible = false; self.menubar.visible = false; self.toolbar.visible = false; self.locationbar.visible = false; self.statusbar.visible = false; self.personalbar.visible = false; } else { thisWin.resizeTo(iWinWidth + 10,iWinHeight + 25); } } thisWin.moveTo((screen.availWidth-iReSizeWidth)/2 ,(screen.availHeight-iReSizeHeight)/2); thisWin.focus(); }