Files
doc/static/ad.html
teasiu f0ee91cb4f ad
2023-12-24 00:07:11 +08:00

57 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>广告页面</title>
<style>
/* 让页面内容充满整个视口 */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
/* 居中显示内容 */
body {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
/* 使图片适应手机屏幕 */
img {
max-width: 100%;
height: auto;
}
</style>
<script>
let clickCount = 0;
function recordClick() {
// 增加点击计数
clickCount++;
// 在这里可以添加其他记录点击的操作,比如发送到服务器等
// 跳转到链接地址
window.location.href = "https://www.521f.com";
}
</script>
</head>
<body>
<h1>是兄弟就找我,无兄弟不传奇!</h1>
<!-- 点击图片调用recordClick函数 -->
<a href="javascript:void(0);" onclick="recordClick();">
<img src="ad.jpg" alt="广告图片">
</a>
<!-- 显示点击次数 -->
<p>点击次数: <span id="clickCountDisplay">0</span></p>
<script>
// 在页面加载后更新点击次数的显示
document.getElementById("clickCountDisplay").innerText = clickCount;
</script>
</body>
</html>