能帮我晚上写一段jS代码,控制文字一直向上滚动的效果。在此谢过啦

如题所述

<marquee height="120" direction="up" scrollamount="2" onmouseover="this.stop()" onmouseout="this.start()">

此处放你的内容
<\marquee>
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-01-05
#gg_box{width:263px; height:47px; }
#gg{width:263px; height:43px;}

<div id="gg_box">
<div id="gg">
gsdfgdfgfdgfgfdgfdgfdgfdgfdgg<br/>
</div>
</div>

<script language="javascript">
var box=document.getElementById("gg"),can=true;
box.innerHTML+=box.innerHTML;
box.onmouseover=function(){can=false};
box.onmouseout=function(){can=true};
new function (){
var stop=box.scrollTop%43==0&&!can;
if(!stop)box.scrollTop==parseInt(box.scrollHeight/2)?box.scrollTop=0:box.scrollTop++;
setTimeout(arguments.callee,box.scrollTop%43?10:1000);
};
</script>
相似回答