Connecting Tech Pros Worldwide Help | Site Map

active browser

sean
Guest
 
Posts: n/a
#1: Jul 20 '05
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
Guest
 
Posts: n/a
#2: Jul 20 '05

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@yahoo.se (sean) wrote in message news:<d96513dd.0310270727.716e2bfb@posting.google. 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]
sean
Guest
 
Posts: n/a
#3: Jul 20 '05

re: active browser


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