Html
    Css
    Js

    
                        
* {
	margin:0;
	padding:0;
}
.content {
	position:relative;
	width:400px;
	height:30px;
	margin:50px auto;
	/*-webkit-perspective:1000px;
	-moz-perspective:1000px;
	-ms-perspective:1000px;
	*/
        perspective:1000px;
	/*景深相当于眼睛距离元素的位置距离*/
}
.content .open {
	transform:rotateX(0);
	animation:open 1s linear;
}
@keyframes open {
	0% {
	transform:rotateX(-90deg);
}
20% {
	transform:rotateX(30deg);
}
40% {
	transform:rotateX(-60deg);
}
60% {
	transform:rotateX(60deg);
}
80% {
	transform:rotateX(-30deg);
}
100% {
	transform:rotateX(0);
}
}.content .close {
	transform:rotateX(-120deg);
	animation:close 1s ease;
}
@keyframes close {
	0% {
	transform:rotateX(0);
}
100% {
	transform:rotateX(-90deg);
}
}.content div {
	position:absolute;
	left:0;
	top:30px;
	width:100%;
	transform-style:preserve-3d;
	transform-origin:top;
	transform:rotateX(-90deg);
}
.content div span {
	display:block;
	height:28px;
	line-height:30px;
	text-align:center;
	background:rgb(153,102,102);
}
input {
	position:absolute;
	left:0;
	top:0;
	z-index:999;
	width:400px;
	height:30px;
	border:0;
	background-color:#c74;
}

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

简单的手风琴动画

更新时间:2019-08-29 23:50:01

纯js,手风琴动画菜单导航,供学习参考

0