网页 文字滚动代码
来源:百度知道 编辑:UC知道 时间:2024/06/05 10:26:51
请问这样的效果的代码是怎么样的!
我要的是循环滚动!就像别人网站上那个滚动的新闻那样的效果!
希望各位高手指点一下!
是这样吧
<html>
<head>
<style>
.marquee{
width:120px;
height:200px;
background-color:orange;
}
.tx{
top: 100px;
}
</style>
<script>
var func;
var oTop = 180;
function marquee(){
var tx = document.getElementById("tx");
tx.style.paddingTop = oTop;
oTop -= 3;
if(oTop <= 0){
oTop = 180;
}
}
window.onload = function(){
out();
}
function over(){
clearInterval(func);
}
functio