0
我打開一個彈出窗口從JavaScript使用window.open。我想在頁面的右上角打開這個彈出窗口(height =「700px」width =「400px」)。我怎樣才能做到這一點如何打開右側的彈出窗口?
我打開一個彈出窗口從JavaScript使用window.open。我想在頁面的右上角打開這個彈出窗口(height =「700px」width =「400px」)。我怎樣才能做到這一點如何打開右側的彈出窗口?
您可以撥打下面的方法:
popUpAtMyWish("yourpage","windownamehere",500,600);
function popUpAtMyWish(pageToLoad, winName, width, height)
{
xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4)){
xposition = (screen.width - width);
yposition = (screen.height - height);
}
var args = "";
args += "width=" + width + "," + "height=" + height + ","
+ "location=0,"
+ "menubar=0,"
+ "resizable=0,"
+ "scrollbars=0,"
+ "statusbar=false,dependent,alwaysraised,"
+ "status=false,"
+ "titlebar=no,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //NN Only
+ "screeny=" + yposition + "," //NN Only
+ "left=" + xposition + "," //IE Only
+ "top=" + yposition; //IE Only
var dmcaWin = window.open(pageToLoad,winName,args);
dmcaWin.focus();
}
,謝謝,我只是想獲得的屏幕工作區中的JavaScript。當我設置window.open(...高度= 0)時,它會打開瀏覽器最高位置的彈出窗口。 – Tuscan 2011-03-11 12:22:48