html - Can I change a non-resizable existing browser window with Javascript to be resizable? - Stack Overflow

Simple question, I have a window that was opened with this codewindow.open(URL, windowName, 'resiz

Simple question, I have a window that was opened with this code

window.open(URL, windowName, 'resizable=no');

I know I can control size and position programmatically after it's loaded but how do I make it simply reziable again? is there any way to override it?

(NOTE: I have no access to modify the opening code, but have full access to the child window code)

Simple question, I have a window that was opened with this code

window.open(URL, windowName, 'resizable=no');

I know I can control size and position programmatically after it's loaded but how do I make it simply reziable again? is there any way to override it?

(NOTE: I have no access to modify the opening code, but have full access to the child window code)

Share Improve this question asked Aug 10, 2011 at 17:54 Eran MedanEran Medan 45.8k61 gold badges187 silver badges281 bronze badges 1
  • did you try setAttribute – zod Commented Aug 10, 2011 at 19:51
Add a ment  | 

5 Answers 5

Reset to default 2

A hack can be this:

window.open(window.location.href, document.title, 'resizable=yes');
window.close();

but it cause your window open a new window and close itself that is not a good UX

You can resize the child window like this:

self.resizeTo(width, height);

As for making the child window resizable again, I don't think you can. The parent window has control of the child.

No, whether a window is resizable is determined when it is opened. Changing this flag after the fact isn't possible. Depending on your goal opening a new (resizable) child window and closing the old one might be an option, I don't think there are any alternatives.

I can't find it in w3c site so this might be deprecated, but window.setResizable(true) should set it's own window resizeable.

Give it a try, check the link for more information on the restrictions.

The method is also listed here.

Of course that, having control over the child, you could also create a new child from it I guess, as a last resort.

var win = window.open(URL, windowName, 'resizable=no');
win.resizeTo(*yourWidth*, *yourHeight*);

you can use resizeTo to your width and height to change the window size

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744747086a4591366.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信