By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,960 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,960 IT Pros & Developers. It's quick & easy.

active browser

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

ja*********@yahoo.se (sean) wrote in message news:<d9**************************@posting.google. com>...
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

Jul 20 '05 #2

P: n/a
not bad, not bad at all
lots of thanks, I will give a tray later on
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.