这段代码实现文字上下滚动一行,每次停几秒,但有时这滚动的文字没有刚好占一行,大家帮忙改改?
<DIV id=icefable1>
<DIV id=box1left>
<LI> 商家: 6302203 人 供求信息数:11873180条 </LI>
<LI> 近期最新供应:1864084条 近期最新求购:28380 </LI>
</DIV>
</DIV>
<SCRIPT type=text/javascript>
marque(320,19, "icefable1 ", "box1left ")
var scrollElem;
var stopscroll;
var stoptime;
var preTop;
var leftElem;
var currentTop;
var marqueesHeight;
function marque(width,height,marqueName,marqueCName){
try{
marqueesHeight = height;
stopscroll = false;
scrollElem = document.getElementById(marqueName);
with(scrollElem){
style.width = width;
style.height = marqueesHeight;
style.overflow = 'hidden ';
noWrap = true;
}
scrollElem.onmouseover = new Function( 'stopscroll = true ');
scrollElem.onmouseout = new Function( 'stopscroll = false ');
preTop = 0;
currentTop = 0;
stoptime = 0;
leftElem = document.getElementById(marqueCName);
scrollElem.appendChild(leftElem.cloneNode(true));
init_srolltext();
}catch(e) {}
}
function init_srolltext(){
scrollElem.scrollTop = 0;
setInterval( 'scrollUp() ', 19);
}
function scrollUp(){
if(stopscroll) return;
currentTop += 1;
if(currentTop == marqueesHeight+1) {
stoptime += 1;
currentTop -= 1;
if(stoptime == (marqueesHeight)*4) {//停顿时间
currentTop = 0;
stoptime = 0;
}
}else{
preTop = scrollElem.scrollTop;
scrollElem.scrollTop += 1;
if(preTop == scrollElem.scrollTop){
scrollElem.scrollTop = marqueesHeight;
scrollElem.scrollTop += 1;
}
}
}
</SCRIPT>
要实现的效果如 阿里巴巴首页滚动文字那样(http://www.alibaba.com.cn)?谢谢.
------解决方案--------------------marque(320,19, "icef