minimize window

Posted on 2009-12-22
Last Modified: 2012-06-21
i want to trigger the same function when the user minimizes the window.


<script src="" type="text/javascript"></script>

<script type="text/javascript">

        window.setTimeout("OpenDialog()", 3000); // 5 secs

        function OpenDialog() {






<p>Page content</p>

<div id="dialog">


                Are you sure?





Open in new window

Question by:yingwho
    LVL 58

    Expert Comment

    There is no way to detect the browser minimizing.
    LVL 1

    Expert Comment

    There is no way to capture the window minimize event. However, depending on what you're doing and which browsers you're targeting, you could play around with the blur and focus events of the window to achieve similar effect.
    LVL 4

    Accepted Solution

    When the window is minimized the window.onblur is fired. And when your windows is restored the window.onfocus event will be fired.
    You can also check the window.outerWidth and window.outerHeight (works in firefox).

    Another technique is to add a flash object on the stage and on the resize of the window the flash will execute a javascript function with the ExternalInterface command.

    Check the following links:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    To Start with ... One of the most annoying things in developing web pages is handling the 'Enter Key' for form submission. The 'Enter Key' makes form submission so easy that the user always tend to use it. The easiest and the most intuitive way …
    Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
    The viewer will learn how to dynamically set the form action using jQuery.
    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…

    737 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

    22 Experts available now in Live!

    Get 1:1 Help Now