首页 > 其他 > 详细

跳转九宫格的制作

时间:2019-09-02 23:23:29      阅读:116      评论:0      收藏:0      [点我收藏+]

代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>跳转九宫格</title>
<!--思路:画盒子16个(4+9+2+1)->九宫格格子->跳转-->
<style>
* {
margin: 0;
padding: 0;
}
#box {
width: 600px;
height: 600px;
border-top: 1px solid #000;
border-left: 1px solid #000;
position:relative;
box-sizing: border-box;
display:inline-block;/*?*/
}

#box .table div {
box-sizing: border-box;
display: inline-block;
width: 196px;
height: 200px;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
}

#box .d1{
box-sizing: border-box;
position:absolute;
width: 196px;
height: 200px;
background: red;
top: 0;
left: 0;
transition: top 1s,left 1s 1s,opacity 1ms 2s;
}

#box:hover .d1{
top: 200px;
left: 200px;
opacity: 0;
}

#box .d2 {
box-sizing: border-box;
position: absolute;
width: 196px;
height: 200px;
background-color: red;
top: 200px;
left: 200px;
transition: top 1s 2s, left 1s 3s, visibility 1s 2s, opacity 1ms 4s;
visibility: hidden;
}

#box:hover .d2{
visibility: visible;
top: 0;
left: 400px;
opacity: 0;
}

#box .d3{
box-sizing: border-box;
position: absolute;
width: 196px;
height: 200px;
background: red;
top: 0;
left:400px;
visibility: hidden;
transition: top 1s 4s,left 1s 5s,visibility 1s 4s,opacity 1ms 6s;
}

#box:hover .d3{
visibility: visible;
top: 408px;
left: 0;
opacity: 0;
}

#box .d4 {
box-sizing: border-box;
position: absolute;
width: 196px;
height: 200px;
background-color: red;
top: 408px;
visibility: hidden;
transition: top 1s 6s,visibility 1ms 6s,opacity 1s 7s;
}

#box:hover .d4{
visibility: visible;
top: 0;
opacity: 0;
}
</style>
</head>
<body>
<div id="box">
<div class="content">
<div class="d1"></div>
<div class="d2"></div>
<div class="d3"></div>
<div class="d4"></div>
</div>

<div class="table">
<div ></div>
<div ></div>
<div ></div>
<div ></div>
<div ></div>
<div ></div>
<div ></div>
<div ></div>
<div ></div>
</div>
</div>
</body>
</html>

显示效果:

技术分享图片

 

跳转九宫格的制作

原文:https://www.cnblogs.com/yanyanstyle/p/11448949.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!