-3
应该发生的事情是 当按钮被点击时,交通将按照颜色顺序旋转。所以它会从红色开始,然后是黄色,最后是绿色,然后在按下按钮后重复。感谢您的帮助交通信号灯不显示如琥珀色的红色和绿色
<DOCTYPE html>
<html>
<head>
<title>Marcus's Traffic Lights </title>
<script>
function light() {
setTimeout(Picture1, 4000)
setTimeout(Picture2, 2000)
setTimeout(Picture3, 6000)
}
fuction Picture1()
document.getElementById("red").style.visabillity='visible';
document.getElementById("green").style.visabillity='visible';
}
fuction Picture2()
document.getElementById("red").style.visabillity='visible';
document.getElementById("amber").style.visabillity='visible';
}
</script>
</head>
<body>
<div id="rectangle"style="
width:125px;
height:350px;
background:black;
position: absolute;
left 0px;-1;">
</div>
THIS DOES NOT DISPLAY
<div id="red" style="visiabllity:hidden; width: 100px;
height: 100px;
background: red;
-moz-border-radius: 50px
-webkit-border-radius: 50px;z-index: 10;
border-radius: 50px;"></div>
THIS DOES NOT DISPLAY
<div id="orange" style="visiabllity:hidden; width: 100px;
height: 100px;
background: orange;
-moz-border-radius: 50px
-webkit-border-radius: 50px;z-index: 10;
border-radius: 50px;"></div>
THIS DOES NOT DISPLAY
<div id="green" style="visiabllity:hidden; width: 100px;
height: 100px;
background: green;
-moz-border-radius: 50px
-webkit-border-radius: 50px;z-index: 10;
border-radius: 50px;"></div>
<button onclick="light()"Start</button>
</body>
</html>