jQuery判断当前页面是否被浏览
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>jQuery判断当前页面是否被浏览</title>
</head>
<body>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <script>
    $(document).on('visibilitychange', function(e) {
        if (e.target.visibilityState === "visible") {
            document.title = '被发现啦!';
        } else if (e.target.visibilityState === "hidden") {
            document.title = '藏好啦!';
        }
    });
    </script>
</body>
</html>
 
                    
                
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号