<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
.wrap{margin:30px auto;width:302px;-webkit-perspective:800px; -webkit-transform-style:preserve-3d; position:relative;}
.wrap div{ position:absolute; top:52px;left:0;-webkit-transform-style:preserve-3d; -webkit-transform-origin:top;}
.wrap span{ display:block;width:300px;border:1px solid #000;height:50px; font:16px/50px "宋体"; background:#ccc;}
</style>
</head>
<body>
<input type="button" value="展开" />
<input type="button" value="收缩" />
<div class="wrap" id="list">
<span>第一项</span>
<div>
<span>第二项</span>
<div>
<span>第三项</span>
<div>
<span>第四项</span>
<div>
<span>第五项</span>
<div>
<span>第六项</span>
<div>
<span>第七项</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
window.onload=function()
{
var oList=document.getElementById("list");
var aDiv=oList.getElementsByTagName("div");
var aBtn=document.getElementsByTagName("input");
aBtn[1].onclick=function()
{
for(var i=0;i<aDiv.length;i++)
{
aDiv[i].style.transition="0.5s "+(aDiv.length-i)*100+"ms";
aDiv[i].style.WebkitTransform="rotateX(60deg)";
}
};
aBtn[0].onclick=function()
{
for(var i=0;i<aDiv.length;i++)
{
aDiv[i].style.transition="0.5s "+i*100+"ms";
aDiv[i].style.WebkitTransform="rotateX(0deg)";
}
};
};
</script>
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
@-webkit-keyframes open{
0%
{
-webkit-transform:rotateX(-120deg);
}
40%
{
-webkit-transform:rotateX(30deg);
}
60%
{
-webkit-transform:rotateX(-20deg);
}
80%
{
-webkit-transform:rotateX(10deg);
}
100%
{
-webkit-transform:rotateX(0deg);
}
}
.wrap{margin:30px auto;width:300px;-webkit-perspective:800px;position:relative;}
.wrap h2{ height:50px;background:#F03; text-align:center; font:16px/50px "微软雅黑"; color:#fff; position:relative;z-index:2;}
.wrap div{ position:absolute; top:32px;left:0;-webkit-transform-style:preserve-3d; -webkit-transform-origin:top; -webkit-transform:rotateX(-120deg); transition:.5s;}
.wrap>div{ top:50px;}
.wrap .open{-webkit-animation:open 2s;-webkit-transform:rotateX(0deg);}
.wrap span{ display:block;width:300px;height:30px; font:14px/30px "宋体"; background:#6F3; text-indent:15px; color:#fff; transition:.5s; box-shadow:inset 0 0 30px 20px rgba(0,0,0,1);}
.wrap .open>span{box-shadow:inset 0 0 30px 10px rgba(0,0,0,0);}
.wrap span:hover{ background:#FF0;text-indent:30px;}
</style>
</head>
<body>
<input type="button" value="展开" />
<input type="button" value="收缩" />
<div class="wrap" id="list">
<h2>标题</h2>
<div>
<span>第一项</span>
<div>
<span>第二项</span>
<div>
<span>第三项</span>
<div>
<span>第四项</span>
<div>
<span>第五项</span>
<div>
<span>第六项</span>
<div>
<span>第七项</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
window.onload=function()
{
var oList=document.getElementById("list");
var aDiv=oList.getElementsByTagName("div");
var aBtn=document.getElementsByTagName("input");
var oTimer=null;
aBtn[1].onclick=function()
{
var i=aDiv.length-1;
clearInterval(oTimer);
oTimer=setInterval(function(){
aDiv[i].className="";
i--;
if(i<0)
{
clearInterval(oTimer);
}
},50);
};
aBtn[0].onclick=function()
{
var i=0;
clearInterval(oTimer);
oTimer=setInterval(function(){
aDiv[i].className="open";
i++;
if(i==aDiv.length)
{
clearInterval(oTimer);
}
},200);
};
};
</script>
</body>
</html>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有