- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
javascript - Is there a way to detect if a browser window is not currently active?
I have JavaScript that is doing activity periodically. When the user is not looking at the site (i.e., the window or tab does not have focus), it'd be nice to not run.
Is there a way to do this using JavaScript?
My reference point: Gmail Chat plays a sound if the window you're using isn't active.
Page Visibility API: http://www.w3.org/TR/page-visibility/
MDN: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
read notes: https://dev.opera.com/blog/page-visibility-api-support-in-opera-12-10/
required for IE 9 and lower: http://www.thefutureoftheweb.com/blog/detect-browser-window-focus
Видео javascript - Is there a way to detect if a browser window is not currently active? канала Code Samples
Is there a way to do this using JavaScript?
My reference point: Gmail Chat plays a sound if the window you're using isn't active.
Page Visibility API: http://www.w3.org/TR/page-visibility/
MDN: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
read notes: https://dev.opera.com/blog/page-visibility-api-support-in-opera-12-10/
required for IE 9 and lower: http://www.thefutureoftheweb.com/blog/detect-browser-window-focus
Видео javascript - Is there a way to detect if a browser window is not currently active? канала Code Samples
Комментарии отсутствуют
Информация о видео
7 апреля 2024 г. 21:22:00
00:02:22
Другие видео канала




















