//这里的高度 style="height: 26px如果不确定的话,需要自定义输入,要不然如果定义高了而ul里的li没达到此高度会造成无法滚动
<div id="demo" style="height: 26px;">
<div id="demo1">
<ul>
<li>・<a href="//www.VeVB.COm/">武林网1</a></li>
<li>・<a href="//www.VeVB.COm/">武林网2</a></li>
<li>・<a href="//www.VeVB.COm/">武林网3</a></li>
<li>・<a href="//www.VeVB.COm/">武林网4</a></li>
</ul>
</div>
<div id="demo2">
</div>
<script type="text/javascript">
//文字无间断滚动代码,兼容IE、Firefox、Opera
var speed=60;
var FGDemo=document.getElementById('demo');
var FGDemo1=document.getElementById('demo1');
var FGDemo2=document.getElementById('demo2');
FGDemo2.innerHTML=FGDemo1.innerHTML
function Marquee1(){
if(FGDemo2.offsetHeight-FGDemo.scrollTop<=0)
FGDemo.scrollTop-=FGDemo1.offsetHeight
else{
FGDemo.scrollTop++
}
}
var MyMar1=setInterval(Marquee1,speed)
FGDemo.onmouseover=function() {clearInterval(MyMar1)}
FGDemo.onmouseout=function() {MyMar1=setInterval(Marquee1,speed)}
</script>
</div>
</body>
</html>
新闻热点
疑难解答