注册 登录
编程论坛 WEB前端(UI)

HTML问题

zacom 发布于 2007-09-30 00:17, 1081 次点击
用<marquee direction="left">
.....(插入图片)
</marquee>
但在中间会出现空白,我想让它不出现空白怎么办.
5 回复
#2
lmhllr2007-09-30 10:25
在marquee加CSS,<marquee style="margin:0px; paudding:0px;"....>

#3
huangyong2007-09-30 13:09

代码贴出来;
<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编辑过]

#4
zacom2007-09-30 21:33

有没有用VBscript写的

#5
huangyong2007-09-30 21:56
网络上滚动一般都是用的这个啊?
这个也很好用啊
我没有VBscript写的这样的脚本。
#6
lmhllr2007-10-01 19:31
vbs只能在IE上运行...会挡掉一部分用户的
1