본문 바로가기

화면 활성화 비활성화 active deactive , visibilitychange

web/javascript by 낼스 2022. 8. 19.

 

document.addEventListener('visibilitychange', function() {
if (document.hidden) {
if ( handleInterval > 0 ) clearInterval(handleInterval);
} else {
if ( handleInterval > 0 ) clearInterval(handleInterval);
console.log("============== ACTIVE =============");
handleInterval = setInterval(()=>{
},intervalTime);
}
}, false);

'web > javascript' 카테고리의 다른 글

Axios in Typescript  (0) 2022.09.04
Fetch in TypeScript  (0) 2022.09.04
antd useRef current.focus  (0) 2022.06.14
typescript onchange moment  (0) 2022.06.12
react class componet  (0) 2022.04.04

댓글