农行业务有个需求是展示获取的数据滚动展示,我用css3动画将数据进行展示,代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
@-webkit-keyframes move {
0% {
top: 0;
}
100% {
top: -500px;
}
}
#wrap {
width: 100px;
height: 100px;
border: 1px solid #000;
position: relative;
margin: 100px auto;
overflow: hidden;
}
#list {
position: absolute;
left: 0;
top: 0;
margin: 0;
padding: 0;
-webkit-animation: 5s move infinite linear;
width: 200%;
}
#list li {
list-style: none;
width: 98px;
height: 98px;
border: 1px solid #fff;
background: #000;
color: #fff;
font: 50px/98px Arial;
text-align: center;
}
#wrap:hover #list {
-webkit-animation-play-state: paused;
}
</style>
</head>
<body>
<div id="wrap">
<ul id="list">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
</div>
</body>
</html>