BuZz
BuZz

Reputation: 17475

maximize window on document ready with jquery

That might sound like a stupid one but I can't find anything relevant : how to maximize the window on document ready with jquery ? Or any other generic solution that will work fine on all browsers...

Thanks guys ;)

Upvotes: 4

Views: 22599

Answers (4)

klodoma
klodoma

Reputation: 4599

This is not possible for main windows, only for dynamic created windows( created with window.open)

according to:

Quote:

  • You can't resize a window or tab that wasn’t created by window.open.
  • You can't resize a window or tab when it’s in a window with more than one tab.

The same of for chrome. Haven't checked IE/Safari though.

Upvotes: 4

Ryan
Ryan

Reputation: 120

window.moveTo(0, 0);
window.resizeTo(screen.availWidth, screen.availHeight);

Upvotes: 8

Saeed Neamati
Saeed Neamati

Reputation: 35842

I found this method. But I can't make it work. Theoretically, it should be possible to change the width and height of the screen, using positive values.

window.resizeBy(xDelta, yDelta);

For more information, visit http://www.w3schools.com/jsref/met_win_resizeby.asp.

Upvotes: -2

Naftali
Naftali

Reputation: 146310

NO

You cannot do this

Control over the user's browser (minimize, maximize) is for the user only.

Upvotes: -9

Related Questions