【发布时间】:2011-05-03 08:34:12
【问题描述】:
我想打开一个没有菜单栏、工具栏或地址栏的新浏览器窗口,并且具有特定大小(例如 300 x 600 像素),位于左上角。
如何以跨浏览器的方式执行此操作?
【问题讨论】:
标签: javascript html browser cross-browser popupwindow
我想打开一个没有菜单栏、工具栏或地址栏的新浏览器窗口,并且具有特定大小(例如 300 x 600 像素),位于左上角。
如何以跨浏览器的方式执行此操作?
【问题讨论】:
标签: javascript html browser cross-browser popupwindow
window.open ("http://www.javascript-coder.com","mywindow","menubar=0,resizable=0,width=350,height=250");
或有特定位置
window.open('yourpage','mywin','left=0,top=0,width=600,height=300,toolbar=0,resizable=0,menubar=0');
参考:
http://www.javascripter.net/faq/openinga.htm
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
【讨论】:
请注意,出于安全原因,大多数浏览器会在弹出窗口上强制使用地址栏。
【讨论】:
window.open("your URL","win",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=785,height=600');
window.open() 方法在所有主流浏览器中都有支持 Refer this page
【讨论】: