手风琴特效 transition

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
*{ margin:0px; padding:0px;}
</style>
</head>

<body>
<div style=" width:700px; height:300px; background-color:#E7E7E7; overflow:hidden;position:relative;">
    <div id="d1" style="width:500px; height:300px; background-color:#FF8486;position:absolute; float:left; transition:0.7s;" onMouseOver="bian(1)"><img src="路易十三/logo.png" ></div>
    <div id="d2" style="width:500px; height:300px; background-color:#FFDE6D;position:absolute; float:left; left:50px; transition:0.7s;" onMouseOver="bian(2)"></div>
    <div id="d3" style="width:500px; height:300px; background-color:#83FF48;position:absolute; float:left; left:100px; transition:0.7s;" onMouseOver="bian(3)"></div>
    <div id="d4" style="width:500px; height:300px; background-color:#63EEF5;position:absolute; float:left; left:150px; transition:0.7s;" onMouseOver="bian(4)"></div>
    <div id="d5" style="width:500px; height:300px; background-color:#776CFF;position:absolute; float:left; left:200px; transition:0.7s;" onMouseOver="bian(5)"></div>
</div>
<br>
<div style=" width:700px; height:300px; background-color:#E7E7E7; overflow:hidden;position:relative;">
    <div id="dd1" style="width:500px; height:300px; background-color:#FF8486;position:absolute; float:left; transition:0.7s;" onClick="biann(1)"></div>
    <div id="dd2" style="width:500px; height:300px; background-color:#FFDE6D;position:absolute; float:left; left:50px; transition:0.7s;" onClick="biann(2)"></div>
    <div id="dd3" style="width:500px; height:300px; background-color:#83FF48;position:absolute; float:left; left:100px; transition:0.7s;" onClick="biann(3)"></div>
    <div id="dd4" style="width:500px; height:300px; background-color:#63EEF5;position:absolute; float:left; left:150px; transition:0.7s;" onClick="biann(4)"></div>
    <div id="dd5" style="width:500px; height:300px; background-color:#776CFF;position:absolute; float:left; left:200px; transition:0.7s;" onClick="biann(5)"></div>
</div><br>


<div style=" width:2500px; height:300px; background-color:#111111; position:relative;"></div>
</body>
</html>
<script language="javascript1.1">
function bian(n)
{
    if(n==1){
        document.getElementById("d1").style.left="";
        document.getElementById("d2").style.left="500px";
        document.getElementById("d3").style.left="550px";
        document.getElementById("d4").style.left="600px";
        document.getElementById("d5").style.left="650px";
    }
    else if(n==2){
        document.getElementById("d1").style.left="";
        document.getElementById("d2").style.left="50px";
        document.getElementById("d3").style.left="550px";
        document.getElementById("d4").style.left="600px";
        document.getElementById("d5").style.left="650px";
        }
    else if(n==3){
        document.getElementById("d1").style.left="";
        document.getElementById("d2").style.left="50px";
        document.getElementById("d3").style.left="100px";
        document.getElementById("d4").style.left="600px";
        document.getElementById("d5").style.left="650px";
        }
    else if(n==4){
        document.getElementById("d1").style.left="";
        document.getElementById("d2").style.left="50px";
        document.getElementById("d3").style.left="100px";
        document.getElementById("d4").style.left="150px";
        document.getElementById("d5").style.left="650px";
        }
    else if(n==5){
        document.getElementById("d1").style.left="";
        document.getElementById("d2").style.left="50px";
        document.getElementById("d3").style.left="100px";
        document.getElementById("d4").style.left="150px";
        document.getElementById("d5").style.left="200px";
        }
}
function biann(n)
{
    if(n==1){
        document.getElementById("dd1").style.left="";
        document.getElementById("dd2").style.left="500px";
        document.getElementById("dd3").style.left="550px";
        document.getElementById("dd4").style.left="600px";
        document.getElementById("dd5").style.left="650px";
    }
    else if(n==2){
        document.getElementById("dd1").style.left="";
        document.getElementById("dd2").style.left="50px";
        document.getElementById("dd3").style.left="550px";
        document.getElementById("dd4").style.left="600px";
        document.getElementById("dd5").style.left="650px";
        }
    else if(n==3){
        document.getElementById("dd1").style.left="";
        document.getElementById("dd2").style.left="50px";
        document.getElementById("dd3").style.left="100px";
        document.getElementById("dd4").style.left="600px";
        document.getElementById("dd5").style.left="650px";
        }
    else if(n==4){
        document.getElementById("dd1").style.left="";
        document.getElementById("dd2").style.left="50px";
        document.getElementById("dd3").style.left="100px";
        document.getElementById("dd4").style.left="150px";
        document.getElementById("dd5").style.left="650px";
        }
    else if(n==5){
        document.getElementById("dd1").style.left="";
        document.getElementById("dd2").style.left="50px";
        document.getElementById("dd3").style.left="100px";
        document.getElementById("dd4").style.left="150px";
        document.getElementById("dd5").style.left="200px";
        }
}
</script>

 

转载于:https://www.cnblogs.com/ordinaryk/p/6088676.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值