Can jQuery change `$ (window) .width ()`?

Is it possible to change $(window).width()through jQuery, so something like this is possible:

$('#click').click(function(){
   //menu 100px with $(window).width();
});
+5
source share
3 answers

No no. The main DOM element itself does not support changing the width of the browser window. You can resize the content area (outer width / inner width). However, I do not think that this affects the size of the window, which you seem to want to achieve.

+7
source

You can control the size of the new browser window that you open with window.open(). See https://developer.mozilla.org/En/Window.open for how to do this.

+3
source

( Chrome ), FireFox , :

window.resizeTo(1280,1024);

javascript:window.resizeTo(1280,1024);

, , , , .

+1
source

All Articles