<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="5;url=http://www.foxccs.com">
<title>页面跳转</title>
<style>
#countdownTimer {
color: red; /* 设置文字颜色为红色 */
}
</style>
<script>
let countdown = 5; // 设置倒计时时间(秒)
function updateCountdown() {
countdown--; // 每次调用减少1秒
document.getElementById("countdownTimer").innerText = `倒计时:${countdown} 秒`;
if (countdown <= 0) {
window.location.href = "http://www.foxccs.com"; // 倒计时结束时跳转
} else {
setTimeout(updateCountdown, 1000); // 每秒更新一次
}
}
window.onload = function() {
updateCountdown(); // 页面加载时开始倒计时
};
</script>
</head>
<body>
<div style="display: grid; place-items: center; height: 100vh;">
<h2 id="countdownTimer">倒计时:5 秒</h2>
<p>如果您的浏览器不支持自动跳转,请<a href="http://www.foxccs.com">点击这里</a>。</p>
</div>
</body>
</html>
没有回复内容