Html
    Css
    Js

    
                        
  button.accordion {
	background-color:#eee;
	color:#444;
	cursor:pointer;
	padding:18px;
	width:100%;
	border:none;
	text-align:left;
	outline:none;
	font-size:15px;
	transition:0.4s;
}
button.accordion.active,button.accordion:hover {
	background-color:#ddd;
}
div.panel {
	padding:0 18px;
	background-color:white;
	max-height:0;
	overflow:hidden;
	transition:max-height 0.2s ease-out;
}
button.accordion:after {
	content:'\002B';
	color:#777;
	font-weight:bold;
	float:left;
	margin-left:5px;
}
button.accordion.active:after {
	content:"\2212";
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.3
 立即下载

原生js写出手风琴

简单地写了一个手风琴效果,关键时候能让你用的上就好

0