Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

browser tab switch event js

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script>
        document.addEventListener("visibilitychange", (event) => {
            if (document.visibilityState == "visible") {
                alert("tab is active")
            } else {
                alert("tab is inactive")
            }
        });
    </script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: attributes in same line prettier 
Javascript :: reduce to calculate sum react 
Javascript :: Sort an array by both ascending and descending order in js 
Javascript :: js change text on hover 
Javascript :: queryselector in javascript 
Javascript :: name arrow function 
Javascript :: manually fire event using javascript 
Javascript :: dynamic regex javascript 
Javascript :: get current date javascript full month 
Javascript :: js loop through form inputs 
Javascript :: datatable change classname by value 
Javascript :: filter array 
Javascript :: how to display date in javascript 
Javascript :: how to do an isogram in javascript 
Javascript :: history javascript 
Javascript :: get selected value in dropdown 
Javascript :: redux saga fetch api 
Javascript :: dom event 
Javascript :: jQuery Stop Animations 
Javascript :: convert array to csv javascript 
Javascript :: vue router transition 
Javascript :: array destructuring js 
Javascript :: javascript first letter uppercase 
Javascript :: carbon to moment js conversion 
Javascript :: remove a value to an array of javascript 
Javascript :: js get screen width 
Javascript :: material ui icons next js 
Javascript :: express and node 
Javascript :: how to connect react to backend 
Javascript :: convert a string array into object using kerys 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =