69 lines
1.4 KiB
HTML
69 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>关闭弹窗</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
body {
|
|
height: 3000px;
|
|
}
|
|
|
|
.gg {
|
|
width: 200px;
|
|
height: 200px;
|
|
background: red;
|
|
position: fixed;
|
|
right: 0;
|
|
bottom: 0;
|
|
}
|
|
|
|
.gg span {
|
|
position: absolute;
|
|
right: 10px;
|
|
top: 10px;
|
|
font-size: 20px;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="gg">
|
|
<span> x </span>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
var close = $(".gg span"),
|
|
gg = $(".gg"),
|
|
nums = 0
|
|
close.onclick = () => {
|
|
nums += 1;
|
|
if (nums == 1){
|
|
SearchBaidu()
|
|
}
|
|
if (nums == 3){
|
|
gg.style.display = "none"
|
|
}
|
|
}
|
|
|
|
function SearchBaidu() {
|
|
open("https://www.baidu.com")
|
|
}
|
|
function $(className) {
|
|
return document.querySelector(className)
|
|
}
|
|
function _(className) {
|
|
return document.querySelectorAll(className)
|
|
}
|
|
</script>
|
|
|
|
</html> |