在做頁面時,使用者要求,不同的分辨率,彈出視窗的位置不同,我想是不是先獲得螢幕寬度,然後付值給變量,再在onclick中設定參數
<script> <BR>alert(screen.width "*" screen.height> <BR>alert(screen.width "*" screen.height) <BR>< /script> </script>
程式碼如下:function centerWindow(url,w,h){
l=(screen.width-w)/2
t=(screen.height-h)/2
window.open(url, '','left=' l ',top=' t ',width=' w ',height=' h)
}
------------------------------------ ---------------------------
這段程式碼是根據不同的螢幕顯示不同的頁面
下面是傳遞這個參數的
document.write("
"); document.write("
%20%22&Height=%22%20escape(screen.height)%20<BR>%22)
");
document.write("");