求教js高手,求教js高手。用asp做的网站,从数据库里调出几张图片想让这些图片不间断向左滚动,应该怎么写
加我1904249061<divclass="main_left_djcshow"><%sql="selecttop10*fromarticle_infowherencl...
加我1904249061
<div class="main_left_djcshow">
<%
sql="select top 10 * from article_info where nclassid=190"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
while not rs.eof
response.Write "<a href='house_article.asp?unid="&rs("unid")&"' target=""_blank"">"
response.Write "<img src=""UpFiles/"&rs("defaultpic")&"""></a>"
rs.movenext()
wend
rs.close()
set rs=nothing
%>
</div> 展开
<div class="main_left_djcshow">
<%
sql="select top 10 * from article_info where nclassid=190"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
while not rs.eof
response.Write "<a href='house_article.asp?unid="&rs("unid")&"' target=""_blank"">"
response.Write "<img src=""UpFiles/"&rs("defaultpic")&"""></a>"
rs.movenext()
wend
rs.close()
set rs=nothing
%>
</div> 展开
展开全部
你这样不行的,下面的复制进去,宽度你自己调
<div id="scroll_div" style="overflow: hidden; WIDTH: 560px;">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="scroll_begin">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<%
Set Rs = Conn.Execute("select top 10 * from article_info where nclassid=190")
IF Not (Rs.EOF AND Rs.BOF) Then
While not rs.eof%>
<td align="center"><a href="house_article.asp?unid=<%=rs("unid")%>"><img src="UpFiles/<%=rs("defaultpic")%>" hspace="10" vspace="10" border="0"/><br />
</a></td>
<%Rs.MoveNext
Wend
End IF
Rs.Close
Set Rs = Nothing
%> </tr>
</table>
<td id="scroll_end"></td>
</tr>
</table>
</div></div>
<script>
var speed1=40
var scroll_end = document.getElementById("scroll_end");
var scroll_div = document.getElementById("scroll_div");
scroll_end.innerHTML=scroll_begin.innerHTML
function Marquee1(){
if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)
scroll_div.scrollLeft-=scroll_begin.offsetWidth
else{
scroll_div.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,speed1)
scroll_div.onmouseover=function() {clearInterval(MyMar1)}
scroll_div.onmouseout=function() {MyMar1=setInterval(Marquee1,speed1)}
</script>
<div id="scroll_div" style="overflow: hidden; WIDTH: 560px;">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="scroll_begin">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<%
Set Rs = Conn.Execute("select top 10 * from article_info where nclassid=190")
IF Not (Rs.EOF AND Rs.BOF) Then
While not rs.eof%>
<td align="center"><a href="house_article.asp?unid=<%=rs("unid")%>"><img src="UpFiles/<%=rs("defaultpic")%>" hspace="10" vspace="10" border="0"/><br />
</a></td>
<%Rs.MoveNext
Wend
End IF
Rs.Close
Set Rs = Nothing
%> </tr>
</table>
<td id="scroll_end"></td>
</tr>
</table>
</div></div>
<script>
var speed1=40
var scroll_end = document.getElementById("scroll_end");
var scroll_div = document.getElementById("scroll_div");
scroll_end.innerHTML=scroll_begin.innerHTML
function Marquee1(){
if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)
scroll_div.scrollLeft-=scroll_begin.offsetWidth
else{
scroll_div.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,speed1)
scroll_div.onmouseover=function() {clearInterval(MyMar1)}
scroll_div.onmouseout=function() {MyMar1=setInterval(Marquee1,speed1)}
</script>
展开全部
<%
sub a()
sql="select top 10 * from article_info where nclassid=190"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
while not rs.eof%>
<table><tr><td><a href='house_article.asp?unid="&rs("unid")&"' target=""_blank""><img src=""UpFiles/"&rs("defaultpic")&"""></a></td></tr></table>
<%
rs.movenext()
wend
rs.close
set rs=nothing
end sub
%>
<table><tr><td><marquee><%a()%></marquee></td></tr></table>
sub a()
sql="select top 10 * from article_info where nclassid=190"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
while not rs.eof%>
<table><tr><td><a href='house_article.asp?unid="&rs("unid")&"' target=""_blank""><img src=""UpFiles/"&rs("defaultpic")&"""></a></td></tr></table>
<%
rs.movenext()
wend
rs.close
set rs=nothing
end sub
%>
<table><tr><td><marquee><%a()%></marquee></td></tr></table>
追问
这个还是有空隙..不过楼上的方法很好,哈哈,谢谢你了a
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询