主题:图片滚动
各位大家:本人初接触网站开发,遇到个问题,图片滚动一段时间之后,就停下来,不滚动了,为什么??该怎么修改啊?
<div align='center' id='demo' style='overflow:hidden;height:130px;width:966px;'>
<%
set RsPic=server.createobject("adodb.recordset")
sql="select top 6 * from Info where Ispic=1 and Pw_Good=True ORDER BY id DESC"
RsPic.open sql,conn,1,1
if RsPic.eof or RsPic.bof then
Call NoPic("暂无图文新闻")
end if
%>
<table border='0' align='center' cellpadding='0' cellspace='0'>
<tr>
<td width="687" valign='top' id='demo1'>
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
<tr valign='top'>
<%
do while not RsPic.eof
%>
<td align='center'>
<% Call zf11_NewsShowPic(RsPic("Pic"),RsPic(0),RsPic("Title"),110,90,18)%>
</td>
<%
RsPic.movenext
loop
RsPic.CLOSE
SET RsPic=Nothing
%>
</tr>
</table>
</td>
<td width="24" valign=top id=demo2></td>
</tr>
</table>
<script>
var speed=15
demo2.innerHTML=demo1.innerHTML
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,speed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(Marquee1,speed)}
</script>
</div>
<%
'//新闻图片调用
Function zf11_NewsShowPic(zf11_NewsPic,zf11_NewsInfoID,zf11_NewsTitle,zf11_NewsWith,zf11_NewsHeight,zf11_Newslong)
response.write "<table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td>"
response.write "<TABLE border=0 align=center cellPadding=0 cellSpacing=0>"
response.write "<TR><TD height=8><IMG height=8 src='Images/table/bg_0ltop.gif' width=8></TD>"
response.write "<TD background=Images/table/bg_01.gif height=8></TD>"
response.write "<TD height=8><IMG height=8 src='Images/table/bg_0rtop.gif' width=8></TD></TR>"
response.write "<TR><TD width=8 background=Images/table/bg_03.gif></TD>"
response.write "<TD width=50 height=90 align=center bgColor=#ffffff><a href=typenews.asp?id="&zf11_NewsInfoID&" Title='"&zf11_NewsTitle&"'><img src="&zf11_NewsPic&" border=0 width="&zf11_NewsWith&" height="&zf11_NewsHeight&" ></a></TD>"
response.write "<TD width=8 background=Images/table/bg_04.gif></TD>"
response.write "</TR><TR><TD height=8><IMG height=8 src='Images/table/bg_0lbottom.gif' width=8></TD>"
response.write "<TD background=Images/table/bg_02.gif height=8></TD>"
response.write "<TD height=8><IMG height=8 src='Images/table/bg_0rbottom.gif' width=8></TD>"
response.write "</TR></TABLE>"
response.write "</td></tr><tr><td align=center height=18>"
response.write "<a href=typenews.asp?id="&zf11_NewsInfoID&" title='"&zf11_NewsTitle&"'>"
if GetLen(zf11_NewsTitle)>zf11_Newslong then
response.write LeftStr(zf11_NewsTitle,zf11_Newslong-2)
response.write "..."
else
response.write zf11_NewsTitle
end if
response.write "</a>"
response.write "</td></tr></table>"
End Function
%>
<div align='center' id='demo' style='overflow:hidden;height:130px;width:966px;'>
<%
set RsPic=server.createobject("adodb.recordset")
sql="select top 6 * from Info where Ispic=1 and Pw_Good=True ORDER BY id DESC"
RsPic.open sql,conn,1,1
if RsPic.eof or RsPic.bof then
Call NoPic("暂无图文新闻")
end if
%>
<table border='0' align='center' cellpadding='0' cellspace='0'>
<tr>
<td width="687" valign='top' id='demo1'>
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
<tr valign='top'>
<%
do while not RsPic.eof
%>
<td align='center'>
<% Call zf11_NewsShowPic(RsPic("Pic"),RsPic(0),RsPic("Title"),110,90,18)%>
</td>
<%
RsPic.movenext
loop
RsPic.CLOSE
SET RsPic=Nothing
%>
</tr>
</table>
</td>
<td width="24" valign=top id=demo2></td>
</tr>
</table>
<script>
var speed=15
demo2.innerHTML=demo1.innerHTML
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,speed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(Marquee1,speed)}
</script>
</div>
<%
'//新闻图片调用
Function zf11_NewsShowPic(zf11_NewsPic,zf11_NewsInfoID,zf11_NewsTitle,zf11_NewsWith,zf11_NewsHeight,zf11_Newslong)
response.write "<table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td>"
response.write "<TABLE border=0 align=center cellPadding=0 cellSpacing=0>"
response.write "<TR><TD height=8><IMG height=8 src='Images/table/bg_0ltop.gif' width=8></TD>"
response.write "<TD background=Images/table/bg_01.gif height=8></TD>"
response.write "<TD height=8><IMG height=8 src='Images/table/bg_0rtop.gif' width=8></TD></TR>"
response.write "<TR><TD width=8 background=Images/table/bg_03.gif></TD>"
response.write "<TD width=50 height=90 align=center bgColor=#ffffff><a href=typenews.asp?id="&zf11_NewsInfoID&" Title='"&zf11_NewsTitle&"'><img src="&zf11_NewsPic&" border=0 width="&zf11_NewsWith&" height="&zf11_NewsHeight&" ></a></TD>"
response.write "<TD width=8 background=Images/table/bg_04.gif></TD>"
response.write "</TR><TR><TD height=8><IMG height=8 src='Images/table/bg_0lbottom.gif' width=8></TD>"
response.write "<TD background=Images/table/bg_02.gif height=8></TD>"
response.write "<TD height=8><IMG height=8 src='Images/table/bg_0rbottom.gif' width=8></TD>"
response.write "</TR></TABLE>"
response.write "</td></tr><tr><td align=center height=18>"
response.write "<a href=typenews.asp?id="&zf11_NewsInfoID&" title='"&zf11_NewsTitle&"'>"
if GetLen(zf11_NewsTitle)>zf11_Newslong then
response.write LeftStr(zf11_NewsTitle,zf11_Newslong-2)
response.write "..."
else
response.write zf11_NewsTitle
end if
response.write "</a>"
response.write "</td></tr></table>"
End Function
%>