css3抛物线
页面效果图,有点low,但是这不是重点:重点是下面加黑的代码
<html lang="en"><head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.box{
border: 1px solid #ccc;
position: relative;
width: 300px;
height: 300px;
margin-left: 50px;
}
.bar,.move{
width: 10px;
height: 10px;
border-radius: 50%;
position: absolute;
top: 295px;
left: -5px;
}
.bar{
position: absolute;
background: red;
transition:top 8s ease-in,left 8s linear;
/*重点代码==》可以根据你要的曲线修改
ease-in属性*/
}
.box:hover .bar{
top: 0px;
left:295px;
}
.box:hover .move{
left:295px;
}
.move{
background: #000;
transition:all 8s linear;
}
.line{
width: 2px;
height: 425px;
background: #dadada;
position: absolute;
left: -1px;
bottom: 0px;
transform: rotate(45deg);
transform-origin: center bottom
}
</style>
</head>
<body>
<div class="box">
<div class="move"></div>
<div class="bar"></div>
<div class="line"></div>
</div>
</body>
</html>