请问ASP代码调用数据库的图怎么实现滚动效果,从右向左滚动(或从左向右)
<tablewidth="75"height="134"border="0"cellpadding="0"cellspacing="0"><tr><tdwidth="75...
<table width="75" height="134" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="75" height="55" align="center"><table width="20" height="20" border="2" cellpadding="1" cellspacing="0" bordercolor="#E6EBEF" style="border-collapse:collapse ">
<tr>
<td align="center"><a href="../hotel/img/<%=rs_p("url")%>" target='_blank'><img src="../hotel/img/<%=rs_p("url")%>" width="152" height="116" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="24" align="center" valign="middle"><a href="img/<%=rs_p("url")%>" target='_blank' class="14_7AB900_1"><%=rs_p("name")%></a></td>
</tr>
</table>
<%
sql_p="select top 8 * from hotel_pic where hotelid="&rs("id")&" order by id asc"
set rs_p=Server.CreateObject("ADODB.Recordset")
rs_p.open sql_p,conn,1,1
if (rs_p.eof and rs_p.bof) then
response.write "<td height=40 colspan=6><p>暂无酒店图片</p></td>"
这个是提取图片的 展开
<tr>
<td width="75" height="55" align="center"><table width="20" height="20" border="2" cellpadding="1" cellspacing="0" bordercolor="#E6EBEF" style="border-collapse:collapse ">
<tr>
<td align="center"><a href="../hotel/img/<%=rs_p("url")%>" target='_blank'><img src="../hotel/img/<%=rs_p("url")%>" width="152" height="116" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="24" align="center" valign="middle"><a href="img/<%=rs_p("url")%>" target='_blank' class="14_7AB900_1"><%=rs_p("name")%></a></td>
</tr>
</table>
<%
sql_p="select top 8 * from hotel_pic where hotelid="&rs("id")&" order by id asc"
set rs_p=Server.CreateObject("ADODB.Recordset")
rs_p.open sql_p,conn,1,1
if (rs_p.eof and rs_p.bof) then
response.write "<td height=40 colspan=6><p>暂无酒店图片</p></td>"
这个是提取图片的 展开
1个回答
展开全部
<div id="gpic1" style="overflow:hidden; width:600px; height:135px;">
<table width="74" height="134" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="134" align="center" valign="top" id="gpic1"><table border="0" align='center' cellpadding="0" cellspacing="0">
<tr>
<%Do While Not rs_p.Eof%>
<td valign='top'><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="79" height="127" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="77"><img src="../hotel/img/<%=rs_p("url")%>" width="152" height="116" border="0"></td>
<td rowspan="3"></td>
</tr>
<tr>
<td align="center"><%= rs_p("Title") %></td>
</tr>
</table></td>
</tr>
</table></td>
<%rs_p.movenext
loop %>
</tr>
</table></td>
<td id="gpic2" valign="top"></td>
</tr>
</table>
</div>
<script>
var speed=30
gpic2.innerHTML=gpic1.innerHTML
function Marquee(){
if(gpic2.offsetWidth-gpic.scrollLeft<=0)
gpic.scrollLeft-=gpic1.offsetWidth
else{
gpic.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
gpic.onmouseover=function() {clearInterval(MyMar)}
gpic.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
<table width="74" height="134" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="134" align="center" valign="top" id="gpic1"><table border="0" align='center' cellpadding="0" cellspacing="0">
<tr>
<%Do While Not rs_p.Eof%>
<td valign='top'><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="79" height="127" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="77"><img src="../hotel/img/<%=rs_p("url")%>" width="152" height="116" border="0"></td>
<td rowspan="3"></td>
</tr>
<tr>
<td align="center"><%= rs_p("Title") %></td>
</tr>
</table></td>
</tr>
</table></td>
<%rs_p.movenext
loop %>
</tr>
</table></td>
<td id="gpic2" valign="top"></td>
</tr>
</table>
</div>
<script>
var speed=30
gpic2.innerHTML=gpic1.innerHTML
function Marquee(){
if(gpic2.offsetWidth-gpic.scrollLeft<=0)
gpic.scrollLeft-=gpic1.offsetWidth
else{
gpic.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
gpic.onmouseover=function() {clearInterval(MyMar)}
gpic.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询