ASP 图片循环滚动问题!!
<!--#includefile="../Include/Config.asp"--><html><head></head><bodybottomMargin=0left...
<!--#include file="../Include/Config.asp"-->
<html>
<head>
</head>
<body bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0 marginheight="0"
marginwidth="0">
<div id=demo style="overflow:hidden;height:132;width:100%";>
<table align=left cellpadding=0 cellspace=0 border=0>
<tr>
<td id=demo1 valign=top>
<TABLE cellSpacing=0 cellPadding=0 width=107
border=0 vspace="0">
<%
Sql="select top 10 * from info where classid=255 and deleted='A' order by id desc"
Set Rs=Conn.ExeCute(Sql)
if not Rs.eof and not Rs.bof then
i=0
o=0
do while not Rs.eof
if i=5 then
i=0
%>
<TR>
<%end if%>
<TD width="18%" height=55> <DIV align=center ><a href="../Cpzs_Content.asp?id=<%=Rs("id")%>" target="_blank"><IMG src="../UpLoadfiles/<%=Rs("picname")%>"
alt="<%=Rs("title")%>" width=107 height=66
border=0 align="left"></a></DIV></TD>
<%
Rs.movenext
i=i+1
loop
end if
Rs.close
set Rs=nothing
%>
</TR>
</TABLE>
</td>
<td id=demo2 valign=top></td>
</tr>
</table>
</div>
<script>
var speed=20
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
图片可以滚动,但是呢过段时间就会停止,一刷新就再动!!是什么原因造成的?? 展开
<html>
<head>
</head>
<body bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0 marginheight="0"
marginwidth="0">
<div id=demo style="overflow:hidden;height:132;width:100%";>
<table align=left cellpadding=0 cellspace=0 border=0>
<tr>
<td id=demo1 valign=top>
<TABLE cellSpacing=0 cellPadding=0 width=107
border=0 vspace="0">
<%
Sql="select top 10 * from info where classid=255 and deleted='A' order by id desc"
Set Rs=Conn.ExeCute(Sql)
if not Rs.eof and not Rs.bof then
i=0
o=0
do while not Rs.eof
if i=5 then
i=0
%>
<TR>
<%end if%>
<TD width="18%" height=55> <DIV align=center ><a href="../Cpzs_Content.asp?id=<%=Rs("id")%>" target="_blank"><IMG src="../UpLoadfiles/<%=Rs("picname")%>"
alt="<%=Rs("title")%>" width=107 height=66
border=0 align="left"></a></DIV></TD>
<%
Rs.movenext
i=i+1
loop
end if
Rs.close
set Rs=nothing
%>
</TR>
</TABLE>
</td>
<td id=demo2 valign=top></td>
</tr>
</table>
</div>
<script>
var speed=20
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
图片可以滚动,但是呢过段时间就会停止,一刷新就再动!!是什么原因造成的?? 展开
展开全部
关键词:图片向左滚动,图片无缝向左滚动,图片一直向左滚动,图片左滚动
<table width="90%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="12%" height="126" align="right">企业图片:</td>
<td width="88%" align="left"><table width="121" height="126" border="0" cellpadding="0" cellspacing="0"><tr><td>
<style type="text/css">
<!--
#demo {
background: #FFF;
overflow:hidden;
border: 1px dashed #CCC;
width: 600px;
}
#demo img {
border: 3px solid #F2F2F2;
}
#indemo {
float: left;
width: 800%;
}
#demo1 {
float: left;
}
#demo2 {
float: left;
}
-->
</style>
<div id="demo">
<div id="indemo">
<div id="demo1">
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
</div>
<div id="demo2"></div>
</div>
</div>
<script>
<!--
var speed=10; //数字越大速度越慢
var tab=document.getElementById("demo");
var tab1=document.getElementById("demo1");
var tab2=document.getElementById("demo2");
tab2.innerHTML=tab1.innerHTML;
function Marquee(){
if(tab2.offsetWidth-tab.scrollLeft<=0)
tab.scrollLeft-=tab1.offsetWidth
else{
tab.scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
tab.onmouseover=function() {clearInterval(MyMar)};
tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};
-->
</script>
这个似乎和你的一样。.
但是我用的一点问题都没有
<table width="90%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="12%" height="126" align="right">企业图片:</td>
<td width="88%" align="left"><table width="121" height="126" border="0" cellpadding="0" cellspacing="0"><tr><td>
<style type="text/css">
<!--
#demo {
background: #FFF;
overflow:hidden;
border: 1px dashed #CCC;
width: 600px;
}
#demo img {
border: 3px solid #F2F2F2;
}
#indemo {
float: left;
width: 800%;
}
#demo1 {
float: left;
}
#demo2 {
float: left;
}
-->
</style>
<div id="demo">
<div id="indemo">
<div id="demo1">
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
<a href="#"><img src="http://www.cnrui.cn/other/link/Clear_logo.gif" border="0" /></a>
</div>
<div id="demo2"></div>
</div>
</div>
<script>
<!--
var speed=10; //数字越大速度越慢
var tab=document.getElementById("demo");
var tab1=document.getElementById("demo1");
var tab2=document.getElementById("demo2");
tab2.innerHTML=tab1.innerHTML;
function Marquee(){
if(tab2.offsetWidth-tab.scrollLeft<=0)
tab.scrollLeft-=tab1.offsetWidth
else{
tab.scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
tab.onmouseover=function() {clearInterval(MyMar)};
tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};
-->
</script>
这个似乎和你的一样。.
但是我用的一点问题都没有
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询