JS左右滚动问题怎么设置自动适应UL里面来滚动
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">
.marquee12 {width:903px;height:16px;overflow:hidden; line-height:16px; float:right;}
.marquee12 ul li {float:left; padding:0 15px; line-height:16px;}
</style>
<!--即时消息-->
<table width="980" border="0" cellspacing="0" cellpadding="0">
<tr><td class="news_menu_bottom" style="padding-left:8px;color:#000; font-weight:bold;"> 即时新闻:</td>
<td class="news_menu_bottom">
<div id="marquees" class="marquee12" onmouseover="stop()" onmouseout="start()">
<table border="0" cellspacing="0" cellpadding="0" id="scrollimg" >
<tr>
<td id="simga" >
<div style="width:4500px; height:16px; border:0; " >
<ul><li style="padding-left:20px;">[珠海] 04-21 09:02<a href="http://bbs. target="_blank" style="color:#990000;">♦ 契爷岭巴士站旁海边惊现男尸 环卫工发现后报警</a></li>
<li style="padding-left:20px;">[娱乐] 04-21 09:02<a href="http://info. target="_blank" style="color:#990000;">♦ 传熊黛林被查出脑瘤 男友郭富城急寻名医</a></li>
<li style="padding-left:20px;">[国际] 04-21 08:59<a href="http://info. target="_blank" style="color:#990000;">♦ 韩学者称韩国人祖先发明汉字 表示中国学界承认</a></li>
<li style="padding-left:20px;">[娱乐] 04-21 08:51<a href="http://info. target="_blank" style="color:#990000;">♦ 国王杯决赛-10人皇马1-0巴萨 C罗加时送绝杀</a></li>
</ul> </div>
</td>
<td id="simga1">
</td>
</tr>
</table>
</div>
</td></tr>
</table>
<script language="JavaScript">
var tm = null
var scrollimg=document.getElementById("scrollimg");
var simga1=document.getElementById("simga1");
var simg=document.getElementById("simga");
function newsScroll() {
if (scrollimg.parentNode.scrollLeft != (scrollimg.clientWidth / 2))
scrollimg.parentNode.scrollLeft++;
else
scrollimg.parentNode.scrollLeft = 0
}
window.onload = function() {
simga1.innerHTML = simg.innerHTML
tm = setInterval('newsScroll()', 20)
}
function stop() {
clearInterval(tm)
}
function start() {
tm = setInterval('newsScroll()', 20)
}
</script>
</div>