效果如图:向上滚动
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.box{
width: 400px;
height: 300px;
overflow: hidden;
}
li{
height: 80px;
line-height: 80px;
animation: play 4s linear infinite;
}
@keyframes play{
0%{transform: translateY(0px)}
100%{transform: translateY(-600px)}
}
li:nth-child(2n-1){
background-color: #ddd;
}
ul:hover li{
animation: none
}
</style>
</head>
<body>
<div class="box">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<li>1</li>
</ul>
</div>
</body>
</html>