๐ฅ๏ธํ๋ก ํธ์๋/HTML | CSS | JAVASCRIPT
์๋ฐ์คํฌ๋ฆฝํธ - ๋ธ๋ผ์ฐ์ ํญ์ด ํ์ฑํ์ธ์ง ํ์ธํ๊ธฐ(document.hidden)
Janger
2023. 2. 5. 16:24
728x90
if (document.hidden)
console.log('๋นํ์ฑํ');
else
console.log('ํ์ฑํ');
์ถ์ฒ:
https://stackoverflow.com/questions/1760250/how-to-tell-if-browser-tab-is-active
How to tell if browser/tab is active
Possible Duplicate: Is there a way to detect if a browser window is not currently active? I have a function that is called every second that I only want to run if the current page is in the
stackoverflow.com
728x90