window.open不可调整大小,可滚动

时间:2013-10-01 14:05:40

标签: javascript window.open

我尝试了window.open并希望javascript打开一个带有新网址的新浏览器,并希望新窗口可调整大小并且可滚动

我试过

window.open("someurl", '_blank','windowOpenTab', 'scrollbars=1,resizable=1,width=1000,height=580,left=0, top=0');

编辑1 :尝试window.open(url, '_blank','windowOpenTab', 'scrollbars=1,resizable=1,width=1000,height=580,left=0,top=0'); 仍然没有运气

http://www.javascript-coder.com/window-popup/javascript-window-open.phtml读取window.open,但没有运气:(

4 个答案:

答案 0 :(得分:20)

根据MDN,您在该功能中只能有3个参数。

window.open(strUrl, strWindowName[, strWindowFeatures]);

演示here - 我点了'_blank'并用小窗口做了一个演示,只是为了制作滚动条显示。

所以你可以使用:

window.open("someurl", 'windowOpenTab', 'scrollbars=1,resizable=1,width=1000,height=580,left=0,top=0');

答案 1 :(得分:0)

更改

 window.open("someurl", '_blank','windowOpenTab', 'scrollbars=1,resizable=1,width=1000,height=580,left=0, top=0');

 window.open("someurl", 'windowOpenTab', 'scrollbars=1,resizable=1,width=1000,height=580,left=0, top=0');

只需删除 _blank FIDDLE

答案 2 :(得分:0)

试试这个

 function openPopupWindow(){ 
window.open("http://example.com","popup","width=668,height=548,scrollbars=yes, resizable=yes");     
 }

答案 3 :(得分:-1)

尝试this

popupWin = window.open('http://webdesign.about.com/',
'open_window','menubar, toolbar, location, directories, status, scrollbars, resizable,
dependent, width=640, height=480, left=0, top=0')