.box{width:150px;height:25px;line-height:25px;border:#bbb 1px solid;overflow:hidden;}
.box ul{margin:0;padding:0}
.box li{height:25px;line-height:25px;font-size:12px;text-align:center;list-style-type:none;}
- 第一行
- 第二行
- 第三行
- 第一行
- 第二行
- 第三行
function startmarquee(lh,speed,delay,index){
var t;
var p=false;
var o=document.getelementbyid("marqueebox"+index);
o.innerhtml+=o.innerhtml;
o.onmouseover=function(){p=true}
o.onmouseout=function(){p=false}
o.scrolltop = 0;
function start(){
t=setinterval(scrolling,speed);
if(!p){ o.scrolltop += 1;}
}
function scrolling(){
if(o.scrolltop%lh!=0){
o.scrolltop += 1;
if(o.scrolltop>=o.scrollheight/2) o.scrolltop = 0;
}else{
clearinterval(t);
settimeout(start,delay);
}
}
settimeout(start,delay);
}
startmarquee(25,30,3000,0);
startmarquee(25,40,0,1);
[ctrl+a 全选 注:如需引入外部js需刷新才能执行]