开发者

Make a Unresizable browser window

开发者 https://www.devze.com 2023-02-23 08:20 出处:网络
Im making a web g开发者_如何学Came, but i dont want it to fit on the entire window, i just want something lets say.... 200 x 320, and i want to do a cross browser popup window that canot be resized, t

Im making a web g开发者_如何学Came, but i dont want it to fit on the entire window, i just want something lets say.... 200 x 320, and i want to do a cross browser popup window that canot be resized, there's a way to da that? thanks


There's no way to force a window to be unresizable. The parameters to window.open are simply requests that may be ignored by the browser, and Firefox indeed does this (popups in Firefox can always be resized and the location bar is also always shown).


The proper way is making the browser window itself resizable (and no a popup. thanks.).

Then you create a centered <div> (or <iframe> if you prefer that) which has your preferred size. This allows you to have always the correct size for your game area and you can even put e.g. ads in the area outside (not that anyone appreciates of that, but it's a possibility).


You can use window.open:

window.open(, ,'resizable=no, scrollbars=no, width=200, height=320'); 
0

精彩评论

暂无评论...
验证码 换一张
取 消