js书讯快递

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js书讯快递</title>
    <style>
        #dome{
            width:500px;
            height:200px;
            border:1px solid red;
        }
        #dome1{
            width:500px;
            height:200px;
        }
        #dome2{
            width:500px;
            height:200px;
        }
    </style>
</head>
<body>
<div id="dome" onscroll="show()">
    <div id="dome1">雪山飞狐<br>
        日在校园<br>
        进击的巨人<br>
        碧血剑<br>
        雪山飞狐<br>
        日在校园<br>
        进击的巨人<br>
        碧血剑<br>
        雪山飞狐<br>
    </div>
    <div id="dome2"></div>
</div>
<script>
    window.onload=function(){
        var dome=document.getElementById("dome");
        dome.style="overflow:hidden;";
        var dome1=document.getElementById("dome1");
        var dome2=document.getElementById("dome2");
        dome2.innerHTML=dome1.innerHTML;
        function show(){
            dome.scrollTop++;
            if( dome.scrollTop==200) dome.scrollTop=0;
        }
        var myTime=setInterval(show,90);
    }
</script>
</body>
</html>
阅读更多

没有更多推荐了,返回首页