Solved

how to find browser is minimize or maximize or not

Posted on 2009-04-10
8
1,463 Views
Last Modified: 2012-05-06
I want to check that my browser is minimize or maximize using javascript.If any way to do this,Please tell me.
0
Comment
Question by:scspl
  • 3
  • 3
8 Comments
 
LVL 7

Expert Comment

by:johnnash1180
ID: 24121159
You can try to check the window.outerWidth, window.outerHeight values (in Firefox) of the browser to identify the minimized state.
0
 

Author Comment

by:scspl
ID: 24121272
It is not working in all browsers,let me know if any other way
0
 
LVL 7

Expert Comment

by:johnnash1180
ID: 24121492
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:scspl
ID: 24121691
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
 
LVL 7

Expert Comment

by:johnnash1180
ID: 24121933
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
 

Author Comment

by:scspl
ID: 24127926
but it is not working in IE browser
0
 

Accepted Solution

by:
ee_auto earned 0 total points
ID: 37169588
Question PAQ'd and stored in the solution database.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now