关于一段图片滚动程序的改进
现有有一段程序来实现从数据库中读取图片信息,以每行五张向上滚动,已经实现了无缝滚动,现在希望把这段程序改进一下实现每滚动两行停顿2秒,继续滚动,两行后再停…… ,好像有个delay属性,但是不知道该怎么用。请高手相助!
代码如下:
<div id="demo" style="overflow:hidden;height:200;width:580;color:#ffffff">
<div id="demo1">
<%'====================推荐企业显示============================
set Srs=server.createobject("adodb.recordset")
Ssql="select * from SMT_yp where SMT_key<>2 order by SMT_Vip,SMT_id desc"
Srs.open Ssql,conn,1,1
if Srs.eof and Srs.bof then
response.write "<table><tr><td>没有内容</td></tr></table>"
else
dim i
i=1
response.write "<table cellpadding='5' >"
do while not Srs.eof '============================================
qiyename=LeftT(Trim(Srs("SMT_coname")),13)
if Srs("SMT_logo")<>"" then
qiyelogo=application("cityurl")&Srs("SMT_logo")
else
qiyelogo=application("cityurl")&"img/yplogo.gif"
end if
GoID=Srs("SMT_id")
usertwourl=cityurl&"co.asp?id="&GoID
if i mod 5 =1 then response.write "<tr>"
response.write "<td width='16%' align='center'><table align=center width=100% border=0 cellpadding=2 cellspacing=1 bgcolor=#CCCCCC><tr><td bgcolor=#FFFFFF align=center><div align=center><a href="&usertwourl&" target=_blank title='" & Srs("SMT_coname") & "'><img border='0' src=" & qiyelogo & " width='93' height='60' alt='" & Srs("SMT_coname") & "'></a></div></td></tr><tr><td height=20 bgcolor=#e7e8e9 align=center><font size=2>" & qiyename & "</font></td></tr></table></td>"
if i mod 5 =0 then response.write "</tr>"
i=i+1
Srs.movenext
loop
response.write "</table>"
Srs=close
set Srs=nothing
end if
'=====================推荐企业显示END============================================ %>
</div>
<div id="demo2"></div>
</div>
<script>
var speed=40
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else{
demo.scrollTop++
}
demo.pauseTime = 1000
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
------解决方案--------------------晕,还没改好就按了发送出去哈。