手风琴效果js实现
分享一下手风琴的效果实现,正在学习js的小伙伴们可以看看哦。希望能对你有所帮助。。
代码如下:
<!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>Document</title>
<style>
.but{
width: 500px;
height: 80px;
background-color: rgb(77, 64, 46);
outline: none;
}
#content{
width: 500px;
height: 0px;
background-color: violet;
transition: height 0.5s ease-out;
}
.but.action,.but:hover{
background-color: rgb(255, 136, 0);
color: white;
}
</style>
<script>
window.onload=function(){
for(let i=0;i<but.length;i++){