1,105,371 Community Members

Detect if browser window is maximized or not

Member Avatar
riahc3
 
1,404 posts since May 2008
Reputation Points: 45 [?]
Q&As Helped to Solve: 14 [?]
Skill Endorsements: 18 [?]
Team Colleague
 
0
 

Hello

Now that I know how to get the width/height, how can I detect if the browser is maximized or not?

Crossbrowser of course.

Thanks

Member Avatar
AleMonteiro
Master Poster
758 posts since Aug 2010
Reputation Points: 115 [?]
Q&As Helped to Solve: 143 [?]
Skill Endorsements: 29 [?]
 
0
 

You can check if the screen width/height is the same of the window width/height.

Actually you have to use screen.availHeight to get the screen height without the taskbar.

Something like this(not tested):

if ( screen.height == window.height ) { // FullScreen Mode

}
else if ( screen.availHeight == window.height ) { // Maximized

}
else { // Other size

}
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article