.....(插入图片)
</marquee>
但在中间会出现空白,我想让它不出现空白怎么办.
代码贴出来;
<div id="scroll_div2" style="margin-top:6px; margin-bottom:6px; OVERFLOW:hidden; WIDTH:660px; HEIGHT:100px" align="center">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td width="99%" id="scroll_begin2"><img width="150" height="80" border="0" /><img width="150" height="80" border="0" /><img width="150" height="80" border="0" /><img width="150" height="80" border="0" /><img width="150" height="80" border="0" /><img width="150" height="80" border="0" /><img width="150" height="80" border="0" /><img width="150" height="80" border="0" /><img width="150" height="80" border="0" /><img width="150" height="80" border="0" /><img width="150" height="80" border="0" /><img width="150" height="80" border="0" /></td>
<td width="1%" id="scroll_end2"></td>
</tr>
</table>
</div>
<script type="text/javascript">
var speed2=18 //调整滚动的速度
var scroll_end2 = document.getElementById("scroll_end2");
var scroll_div2 = document.getElementById("scroll_div2");
scroll_end2.innerHTML=scroll_begin2.innerHTML
function Marquee2(){
if(scroll_end2.offsetWidth-scroll_div2.scrollLeft<=0)
scroll_div2.scrollLeft-=scroll_begin2.offsetWidth
else{
scroll_div2.scrollLeft++
}
}
var MyMar2=setInterval(Marquee2,speed2)
scroll_div2.onmouseover=function() {clearInterval(MyMar2)}
scroll_div2.onmouseout=function() {MyMar2=setInterval(Marquee2,speed2)}
</script>
用<marquee>代码是不能控制滚动后的空白的。
用这个JS可以控制不间断滚动。
[此贴子已经被作者于2007-9-30 13:11:05编辑过]