我正试图找到一个工作班轮,不仅能够发挥作用,而且“看好好”,但我已想把菜单翻译成一页,而不是仅仅看上去。
我曾尝试使用网基工具,但可以指出,如何仅仅一次使用网基工具,并用条星表示。
法典如下:
Menu.style.display = "none";
function ShowHide(x) {
x.classList.toggle("change");
var Menu = document.getElementById("Menu");
if (Menu.style.display === "none") {
Menu.style.display = "block";
} else {
Menu.style.display = "none";
}
}
.container {
display: inline-block;
cursor: pointer;
}
.bar1, .bar2, .bar3 {
width: 35px;
height: 5px;
background-color: #333;
margin: 6px 0;
transition: 0.4s;
}
.change .bar1 {
-webkit-transform: rotate(-45deg) translate(-9px, 6px);
transform: rotate(-45deg) translate(-9px, 6px);
}
.change .bar2 {opacity: 0;}
.change .bar3 {
-webkit-transform: rotate(45deg) translate(-8px, -8px);
transform: rotate(45deg) translate(-8px, -8px);
}
}
body {
background-color: rgb(209, 224, 224);
}
.Menu{
width: 150px; background-color: rgb(208, 208, 225); display: none
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="IST101.css">
<script src="hamburger.js" defer></script>
<title>Web design test</title>
</head>
<body>
<div class="container" onclick="ShowHide(this)">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
</div>
<div id="Menu" style="width: 150px; background-color: rgb(208, 208, 225); display: none;">
<h2><a href="Homepage.html">Homepage</a></h2>
<br>
<h2><a href="Subpage1.html">Subpage 1</a></h2>
<br>
<h2><a href="Subpage2.html">Subpage 2</a></h2>
<br>
<h2><a href="Subpage3.html">Subpage 3</a></h2>
<br>
<h2><a href="Subpage4.html">Subpage 4</a></h2>
<br>
<h2><a href="Subpage5.html">Subpage 5</a></h2>
<br>
</div>
</body>
</html>