Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1762
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

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