active browser

S

sean

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

W d'Anjos

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top