程式碼1:最常用的程式碼,比較簡單
程式碼如下:
代碼2:以下程式碼放在之間:
程式碼如下:
以下程式碼放在Tag:
代碼3:
代碼如下:
程式碼如下:
>
代碼如下:
<script> <BR>var mywidth <BR>if (navigator.appName.indexOf('Netscape') != -1) { <BR>mywidth=parseInt(window.outerWidth)-28; <BR>//alert("ns") <BR>} <BR>else{ <BR>if (navigator.appName.indexOf('Microsoft') != -1) { <BR>mywidth=document.body. clientWidth; <BR>//alert("ie") <BR>} <BR>} <BR>var ScreenOffset; <BR>if (mywidth <= 778) { <BR>//alert("1") <BR>}else{ <BR>ScreenOffset = parseInt((mywidth - 778)/2); <BR>ScreenOffset = 0; <BR>// alert("2") <BR>} <🎜en; <BR>window.onresize = function (){ <BR>if (navigator.appName.indexOf('Netscape') != -1) { <BR>mywidth=parseInt(window.outerWidth)-28; <BR>if (self.screenLeft>0){ <BR>maximize.Click(); <BR>} <BR>} <BR>else{ <BR>if (navigator.appName.indexOf('Microsoft') != -1) { <BR>mywidth=document.body.clientWidth; <BR>if(self.screenLeft>0){ <BR>maximize.Click(); <BR>} <BR>} <BR>} <BR>} <BR>function ChangeLocation(){ <BR>var size = screen.width; <BR>if(size!="1024"){ <BR>document.location="index_800_600.aspx"; <BR> } <BR></script>