I'd like to ask how to use css to achieve this scrolling effect.


< html lang= "en" >
< head >
< meta charset= "UTF-8" >
< title > moveUp < / title >
< style >
@ keyframes scroll {
0% {

-webkit-transform: translateY(0px);
transform: translateY(0px);

}
20% {

-webkit-transform: translateY(0px);
transform: translateY(0px);

}
25% {

-webkit-transform: translateY(-30px);
transform: translateY(-30px);

}
45% {

-webkit-transform: translateY(-30px);
transform: translateY(-30px);

}
50% {

-webkit-transform: translateY(-60px);
transform: translateY(-60px);

}
70% {

-webkit-transform: translateY(-60px);
transform: translateY(-60px);

}
75% {

-webkit-transform: translateY(-90px);
transform: translateY(-90px);

}
95% {

-webkit-transform: translateY(-90px);
transform: translateY(-90px);

}
100% {

-webkit-transform: translateY(-120px);
transform: translateY(-120px);

}
}
div {
width: 200px;
height: 30px;
overflow: hidden;
}
ul {
height: 100%;
width: 100%;
-webkit-animation: scroll 5s infinite;
margin: 0;
padding: 0;
}
li {
line-height: 30px;
height: 30px;
}
< / style >
< / head > <

    <li></li>
    <li></li>


< / div >
< / body >
< / html >
these are the effects I want to achieve, but how to write this when the number of li is uncertain

Jan.08,2022

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
    <style>
        *{margin: 0;padding: 0;}
        .wrap{width:100px; margin: 100px auto;position: relative; overflow: hidden;height: 30px;}
        .scroll_box{position: absolute; top: 0;left: 0;width: 100%;}
        .scroll_box li{line-height: 30px; background: red; color: -sharpfff; text-align: center;}
    </style>
</head>
<body>
    <div>
        <div class="wrap">
            <ul class="scroll_box">
                <li>1</li>
                <li>2</li>
                <li>3</li>
            </ul>
        </div>
    </div>
</body>
<script>
    var box = document.getElementsByClassName("scroll_box")[0];
    var len = box.getElementsByTagName('li').length;
    var index = 0;
    setInterval(function(){
        index === (len-1) ? index = 0 : indexPP;
        box.style.top = index*30*-1+'px';
    },1000)

</script>
</html>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36945-2c01a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36945-2c01a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?