active browser

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sean

    active browser

    Have this problem, please

    - I have an HTML page with a timer on it.
    - Start the timer when the page is loaded.
    - Display an alert from 1 to 1 minute based on the timer.

    - If I launch this page in 2 browsers on my comp I want to have the
    alert only from the active window as if the other page is minimized or
    doesn't have focus to NOT display the alert (timer could running
    though).

    Any ideas?

    Jack
  • W d'Anjos

    #2
    Re: active browser

    You can track window focus through the 'onfocus' and 'onblur' events.
    By using them you can keep the window focus status on a 'hasFocus'
    variable, which is then checked by your timer function to control the
    alert display.

    I hope this helps.

    -Wagner

    jackie_sean@yah oo.se (sean) wrote in message news:<d96513dd. 0310270727.716e 2bfb@posting.go ogle.com>...[color=blue]
    > Have this problem, please
    >
    > - I have an HTML page with a timer on it.
    > - Start the timer when the page is loaded.
    > - Display an alert from 1 to 1 minute based on the timer.
    >
    > - If I launch this page in 2 browsers on my comp I want to have the
    > alert only from the active window as if the other page is minimized or
    > doesn't have focus to NOT display the alert (timer could running
    > though).
    >
    > Any ideas?
    >
    > Jack[/color]

    Comment

    • sean

      #3
      Re: active browser

      not bad, not bad at all
      lots of thanks, I will give a tray later on

      Comment

      Working...