Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.resize is not working in chrome and opera

window.resize is not working in chrome and opera ..how to make it work?

like image 461
hema Avatar asked Feb 28 '11 07:02

hema


People also ask

How do I resize my browser in Opera?

Click on the 'Opera' tools menu in the top left of the screen and use the zoom functionality to resize the content. Alternatively you can use keyboard shortcuts 'Ctrl' + '+' or 'Ctrl' + '–' to increase or decrease the text size.

How do I resize a Google window?

- Use the default keyboard shortcut Ctrl+Shift+A (Command+Shift+A for Mac) to resize to the next window size in your list. Keep using the shortcut to rotate window sizes. - You can add and remove sizes in the window sizes list.


1 Answers

There is no window.resize()

...however...

There are:

window.resizeTo(width, height)

window.resizeBy(x, y)

Important notes:

  1. You can't resize a window or tab that wasn’t created by window.open.
  2. You can't resize a window or tab when it’s in a window with more than one tab.
  3. Also, even if you create window by window.open(...) it is not resizable by default ...see 4.
  4. To make window created by window.open() resizable, you must open it with resizable feature

Example of how to create external window with "resizable" feature:

myExternalWindow = window.open("http://myurl.domain", "myWindowName", "resizable");
myExternalWindow.resizeTo(500,500); //resize window to 500x500
myExternalWindow.resizeBy(-100,-100); //make it smaller relatively => to 400x400

PS: There are also browser extensions that allow window resizing... (Chrome)(Mozilla Firefox)

PS2: Chrome extension API - https://developer.chrome.com/extensions/windows

like image 177
jave.web Avatar answered Sep 24 '22 01:09

jave.web