<style type="text/css">
*{margin: 0;padding: 0;}
body {
font-size: 12px;
background-color: #FFF;
overflow: hidden;
}
td{font-size:20px;color: #00FF99;}
.t_data td {border: none;background-color: #fff0ff;height: 50px;padding-left: 2px;}
.f_td {width: 80px;}
</style>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<div id="B1">
<div id="B2">
<table width="160" border="0" cellpadding="0" cellspacing="0"
bgcolor="#cccccc" style="margin-top: 0px;">
<tbody class="t_data">
<tr><td nowrap class="f_td"><a href="#">baidu</a></td></tr>
<tr><td nowrap class="f_td"><a href="#">alibaba</a></td></tr>
<tr><td nowrap class="f_td"><a href="#">sina</a></td></tr>
</tbody>
</table>
</div>
</div>
</td>
</tr>
</table>
var marqueesHeightB1 = 50;//滚动高度
var stopscrollB1=false;
var scrollElemB1=document.getElementById('B1');
with(scrollElemB1){
style.width=164;
style.height=marqueesHeightB1;
style.overflow='hidden';
noWrap=true;
}
scrollElemB1.onmouseover=new Function('stopscrollB1=true');
scrollElemB1.onmouseout=new Function('stopscrollB1=false');
var preTopB1=0 , currentTopB1=0 , stoptimeB1=0 , leftElemB2=document.getElementById('B2');
scrollElemB1.appendChild(leftElemB2.cloneNode(true));
setTimeout('init_srolltextB1()',2000);
function init_srolltextB1(){scrollElemB1.scrollTop=0;setInterval('scrollUpB1()',50);}
function scrollUpB1(){
if(stopscrollB1){return;}
currentTopB1+=1;
if(currentTopB1==(marqueesHeightB1+1)) {
stoptimeB1+=1;currentTopB1-=1;
if(stoptimeB1==40) {
currentTopB1=0;stoptimeB1=0;
}
}else {
preTopB1=scrollElemB1.scrollTop;
scrollElemB1.scrollTop +=1;
if (preTopB1==scrollElemB1.scrollTop){
scrollElemB1.scrollTop=0;
scrollElemB1.scrollTop +=1;
}
}
}