问题描述
我尝试了 window.open
并希望javascript打开一个带有新网址的新浏览器,并希望新窗口可调整大小并且可滚动
I tried window.open
and want the javascript to open a new browser with new url and wants the new window to be resizable and scrollable
我试过
window.open("someurl", '_blank','windowOpenTab', 'scrollbars=1,resizable=1,width=1000,height=580,left=0, top=0');
Edit1 :尝试 window.open(网址) ,'_ blank','windowOpenTab','scrollbars = 1,resizable = 1,width = 1000,height = 580,left = 0,top = 0');
仍然没有运气
Edit1: tried window.open(url, '_blank','windowOpenTab', 'scrollbars=1,resizable=1,width=1000,height=580,left=0,top=0');
still no luck
从但没有运气:(
推荐答案
根据你在该函数中只能有3个参数。
According to MDN you can only have 3 parameters in that function.
window.open(strUrl, strWindowName[, strWindowFeatures]);
演示 - 我下了'_ blank'
并制作了一个带小窗口的演示,只是为了制作滚动条显示。
Demo here - I droped the '_blank'
and made a demo with small window just to make the scrollbar showup.
所以你可以使用:
window.open("someurl", 'windowOpenTab', 'scrollbars=1,resizable=1,width=1000,height=580,left=0,top=0');
这篇关于window.open不可调整大小,可滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!