- 扫描 ID:
- 8cb39042-5c6b-41ed-bb75-5cd8df51999b已完成
- 提交的 URL:
- https://gablaxy.github.io/stellar_system/
- 报告完成时间:
链接 · 找到 0 个
从页面中识别出的传出链接
JavaScript 变量 · 找到 4 个
在页面窗口对象上加载的全局 JavaScript 变量是在函数外部声明的变量,可以从当前范围内的代码中的任何位置访问
名称 | 类型 |
---|---|
onbeforetoggle | object |
documentPictureInPicture | object |
onscrollend | object |
removePA | function |
控制台日志消息 · 找到 2 条
记录到 Web 控制台的消息
类型 | 类别 | 记录 |
---|---|---|
warning | other |
|
error | network |
|
HTML
页面的原始 HTML 正文
<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stellar system</title>
<link rel="stylesheet" href="./style/index.css">
<link rel="stylesheet" href="./style/common.css">
</head>
<body>
<div class="stars"></div>
<div class="all">
<div class="Soleil"></div>
<div class="Mercure planete"></div>
<div class="Venus planete"></div>
<div class="Terre planete"></div>
<div class="Mars planete"></div>
<div class="Jupiter planete"></div>
<div class="Saturne planete"></div>
<div class="Uranus planete"></div>
<div class="Neptune planete"></div>
</div>
<div class="menu">
<h1>Menu</h1>
<h3 id="nom_planete"></h3>
<a href="" id="zoom_link"><button class="zoom">Zoom</button></a>
</div>
<script type="text/javascript">
let planetes = document.querySelectorAll(".planete");
let soleil = document.querySelector(".Soleil");
let menu = document.querySelector(".menu");
let zlink = document.getElementById("zoom_link");
function removePA() {
planetes.forEach(element => {
element.classList.remove("planete_active");
});
}
// When the sun is clicked, the planets are no longer highlighted
soleil.addEventListener("click", function(){
removePA();
menu.style.display = "block";
document.getElementById("nom_planete").innerHTML = "Soleil";
});
planetes.forEach(element => {
element.addEventListener("click", function(){
removePA();
menu.style.display = "block";
element.classList.add("planete_active");
document.getElementById("nom_planete").innerHTML = element.classList[0];
zlink.href = "./planetes/" + element.classList[0] + ".html";
});
});
menu.addEventListener("click", function(){
menu.style.display = "none";
removePA();
});
</script>
</body></html>