`.box{width:250px;
height:52px;
padding:15px 30px;
border:2px solid mediumvioletred;
border-radius:16px;
margin:0 auto;}
.box .count{
width:60px;
color:crimson;
font-size:280%;
line-height:50px;
padding-left:6px;
margin-left:5px;
border:1px solid #fff}
.box div{
margin-left:5px;
float:left;
width:50px;
height:50px;
border-radius:50px;
border:1px solid salmon;}
.gray{background-color: #eee;}
.red{background-color:red;}
.yellow{background-color:yellow;}
.green{background-color:#26ff00;}`
<script>
var lamp={
red:{
obj:document.getElementById('red'),
timeout:30,
style :['red','gray','gray'],
next :
运用JavaScript红绿灯倒计时
最新推荐文章于 2023-05-22 10:22:37 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)