如何新打开一个固定大小的新页面

楼主
如何新打开一个固定大小的新页面
如题,如何打开一个固定大小的新页面?
windows.open的方法不行

showModalDialog 这个方法也不适合

搜索了很多帖子,都没有合适的。[P] [/P]
1楼
不建议打开新页面,现在各浏览器都有拦截新窗口.
可以用层,模拟新窗口,一样能拖动
2楼
用层的话,关闭当前页面或者是看别的页面的话,层也跟着消失了。
3楼
这个是在后台做的,如果是关闭弹出的话,可以让后台操作人员开启对这个网站所有弹出框不阻拦
4楼
[COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]现在windows.open默认都是新开标签,不是新窗口.所以指定不了高和宽的.
下面资料自己看看

<script[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(255, 0, 0)][BGCOLOR=transparent][SIZE=14px]type[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"text/javascript"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]>[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]   [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 139)][BGCOLOR=transparent][SIZE=14px]function[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] open_new_window[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]URL[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px])[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]   [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]{[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]   [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(43, 145, 175)][BGCOLOR=transparent][SIZE=14px]NewWindow[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] window[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px].[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]open[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]URL[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px],[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]"_blank"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px],[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]"toolbar=no,menubar=0,status=0,copyhistory=0,scrollbars=yes,resizable=1,location=0,Width=1500,Height=760"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px])[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px];[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]   [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(43, 145, 175)][BGCOLOR=transparent][SIZE=14px]NewWindow[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px].[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]location [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] URL[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px];[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]   [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]}[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]</script>

[/SIZE][/BGCOLOR][/COLOR]
[P][LINE-HEIGHT=18px][ALIGN=left][FACE=Arial, ][COLOR=rgb(0, 0, 0)][BGCOLOR=rgb(255, 255, 255)][SIZE=14px]window.open() will not open in new tab if it is not happening on actual click event. In the example given the url is being opened on actual click event. [B][B][BGCOLOR=transparent][SIZE=14px]This will work provided user has appropriate settings in the browser[/SIZE][/BGCOLOR][/B][/B].[/SIZE][/BGCOLOR][/COLOR][/FACE][/ALIGN][/LINE-HEIGHT][/P][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]<a[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(255, 0, 0)][BGCOLOR=transparent][SIZE=14px]class[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"link"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]>[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]Link[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]</a>[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px][/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]<script[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]  [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(255, 0, 0)][BGCOLOR=transparent][SIZE=14px]type[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"text/javascript"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]>[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]     $[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]"a.link"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]).[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]on[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]"click"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px],[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 139)][BGCOLOR=transparent][SIZE=14px]function[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px](){[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]         window[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px].[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]open[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]'www.yourdomain.com'[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px],[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]'_blank'[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]);[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]     [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]});[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px][/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]</script>[/SIZE][/BGCOLOR][/COLOR][P][LINE-HEIGHT=18px][ALIGN=left][FACE=Arial, ][COLOR=rgb(0, 0, 0)][BGCOLOR=rgb(255, 255, 255)][SIZE=14px]Similarly, if you are trying to do an ajax call within the click function and want to open a window on success, ensure you are doing the ajax call with async : false option set.[/SIZE][/BGCOLOR][/COLOR][/FACE][/ALIGN][/LINE-HEIGHT][/P][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]<a[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(255, 0, 0)][BGCOLOR=transparent][SIZE=14px]href[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"#"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px] [/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(255, 0, 0)][BGCOLOR=transparent][SIZE=14px]onClick[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]=[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]open_new_window[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]([/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]'http://www.google.com'[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]);[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 255)][BGCOLOR=transparent][SIZE=14px]"[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]>[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(0, 0, 0)][BGCOLOR=transparent][SIZE=14px]google search[/SIZE][/BGCOLOR][/COLOR][COLOR=rgb(128, 0, 0)][BGCOLOR=transparent][SIZE=14px]</a>[/SIZE][/BGCOLOR][/COLOR]
5楼
[P]去收索clearbox这个js效果,很不错[/P][P]window.open 这个开打大小是要看你的浏览器的设置的。所以根本无法显示你的那个问题。[/P]

电脑版 Page created in 0.0283 seconds with 2 queries.