Link to home
Start Free TrialLog in
Avatar of scspl
scspl

asked on

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.
Avatar of johnnash1180
johnnash1180
Flag of India image

You can try to check the window.outerWidth, window.outerHeight values (in Firefox) of the browser to identify the minimized state.
Avatar of scspl
scspl

ASKER

It is not working in all browsers,let me know if any other way
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

Avatar of scspl

ASKER

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
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.
Avatar of scspl

ASKER

but it is not working in IE browser
ASKER CERTIFIED SOLUTION
Avatar of ee_auto
ee_auto

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial