<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>5秒倒计时跳转</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
flex-direction: column;
}
.countdown-container {
text-align: center;
padding: 30px;
background-color: white;
border-radius: 10px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}
.countdown {
font-size: 48px;
font-weight: bold;
color: #ff5722;
margin: 20px 0;
}
.sponsor {
margin-top: 20px;
font-size: 14px;
color: #666;
}
.sponsor a {
color: #2196F3;
text-decoration: none;
}
</style>
</head>
<body>
<div class="countdown-container">
<h1>即将跳转到目标页面</h1>
<div class="countdown" id="countdown">5</div>
<p>页面将在 <span id="seconds">5</span> 秒后自动跳转...</p>
<div class="sponsor">
</div>
</div>
<script>
let seconds = 5;
const countdownElement = document.getElementById('countdown');
const secondsElement = document.getElementById('seconds');
const manualLink = document.getElementById('manualLink');
// 倒计时函数
function updateCountdown() {
seconds--;
countdownElement.textContent = seconds;
secondsElement.textContent = seconds;
if (seconds <= 0) {
// 跳转到目标页面 - www.9pk.homes
window.location.href = "http://www.baidu.com";
} else {
setTimeout(updateCountdown, 1000);
}
}
// 开始倒计时
setTimeout(updateCountdown, 1000);
// 手动跳转链接
manualLink.addEventListener('click', function(e) {
e.preventDefault();
window.location.href = "http://www.baidu.com";
});
</script>
</body>
</html>