• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1855
  • Last Modified:

how to find browser is minimize or maximize or not

I want to check that my browser is minimize or maximize using javascript.If any way to do this,Please tell me.
0
scspl
Asked:
scspl
  • 3
  • 3
1 Solution
 
johnnash1180Commented:
You can try to check the window.outerWidth, window.outerHeight values (in Firefox) of the browser to identify the minimized state.
0
 
scsplAuthor Commented:
It is not working in all browsers,let me know if any other way
0
 
johnnash1180Commented:
It cannot be done. Alternately, you can use your own functions to minimize [not exactly] the window and control your probing.

For this, the below code may be helpful.

<SCRIPT LANGUAGE="JavaScript">
 
function Minimize()
{
window.innerWidth = 100;
window.innerHeight = 100;
window.screenX = screen.width;
window.screenY = screen.height;
alwaysLowered = true;
}
 
function Maximize()
{
window.innerWidth = screen.width;
window.innerHeight = screen.height;
window.screenX = 0;
window.screenY = 0;
alwaysLowered = false;
}
</SCRIPT>
 
<A HREF="javascript:onClick=Minimize()">Click Here To Minimize</A>
<A HREF="javascript:onClick=Maximize()">Click Here To Maximize</A> 

Open in new window

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
scsplAuthor Commented:
I have already seen it.but it is functions for Minimize/Maximize.But I want to detect both these events,whether browser is minimized or maximized
0
 
johnnash1180Commented:
I afraid that you cannot detect whether the browser is minimized or not.

If you use the above function, you can track the browser minimized status, if the user used the above function to minimize the browser, you can control your probe action by introducing a new variable in the above code.

Hope it is clear.
0
 
scsplAuthor Commented:
but it is not working in IE browser
0
 
ee_autoCommented:
Question PAQ'd and stored in the solution database.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now