这是愿详细代码,ASP 数据库我都不懂,能否详细修改下? 输出为横排滚动显示. 谢谢,不盛感激! 10
<MARQUEEwidth="100%"height="400"onMouseOver=this.stop()onMouseOut=this.start()scrolla...
<MARQUEE width="100%" height="400" onMouseOver=this.stop() onMouseOut=this.start() scrollamount=2 Direction=up behavior=Scroll bgcolor="#F0F0F0">
<table width="100%" height="400" border="0" align="center" cellPadding="0" cellSpacing="0" >
<TABLE cellSpacing=0 width="100%">
<tr>
<%
set rscase=server.createobject("adodb.recordset")
sql="select top 5 * from CompHonor order by id desc"
rscase.open sql,conn,1,1
%>
<%i=1 %>
<tr>
<% Do While Not rscase.eof%>
<td><table width="100%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr>
<td colspan="1" align="center"><a href="CaseBig.asp?id=<%=rscase("id")%>" onMouseMove="tip('<%=rscase("CompHonor")%>')" onMouseOut="hide_tip()"><img src="<%=rscase("CompHonor")%>" alt="成功案例" width="198" height="135" border="0" style="border: 2px solid #66CCFF"></a></td>
</tr>
<tr>
<td width="100%" align="center" ><a href="CaseBig.asp?id=<%=rscase("id")%>"><%=rscase("explain")%></a></td>
</tr>
</td>
<% if i mod 1 =0 then%>
</tr>
<tr>
<%end if%>
<%
i=i+1
if i >= 10 then exit do
rscase.MoveNext
loop
%>
</tr>
</table></td>
</tr>
</table>
<%
rscase.close
set rscase=nothing
%>
</td>
</tr>
</table>
</MARQUEE> 展开
<table width="100%" height="400" border="0" align="center" cellPadding="0" cellSpacing="0" >
<TABLE cellSpacing=0 width="100%">
<tr>
<%
set rscase=server.createobject("adodb.recordset")
sql="select top 5 * from CompHonor order by id desc"
rscase.open sql,conn,1,1
%>
<%i=1 %>
<tr>
<% Do While Not rscase.eof%>
<td><table width="100%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr>
<td colspan="1" align="center"><a href="CaseBig.asp?id=<%=rscase("id")%>" onMouseMove="tip('<%=rscase("CompHonor")%>')" onMouseOut="hide_tip()"><img src="<%=rscase("CompHonor")%>" alt="成功案例" width="198" height="135" border="0" style="border: 2px solid #66CCFF"></a></td>
</tr>
<tr>
<td width="100%" align="center" ><a href="CaseBig.asp?id=<%=rscase("id")%>"><%=rscase("explain")%></a></td>
</tr>
</td>
<% if i mod 1 =0 then%>
</tr>
<tr>
<%end if%>
<%
i=i+1
if i >= 10 then exit do
rscase.MoveNext
loop
%>
</tr>
</table></td>
</tr>
</table>
<%
rscase.close
set rscase=nothing
%>
</td>
</tr>
</table>
</MARQUEE> 展开
2个回答
展开全部
给个无间断的代码:改一下长宽就可以了
<div id=demo style="overflow:hidden;height:170px;width:650px;">
<table align=left cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top><table align=left cellpadding=0 cellspace=0 border=0><tr> <%
set rscase=server.createobject("adodb.recordset")
sql="select top 5 * from CompHonor order by id desc"
rscase.open sql,conn,1,1
%><td valign="bottom" align="center"><a href="CaseBig.asp?id=<%=rscase("id")%>" onMouseMove="tip('<%=rscase("CompHonor")%>')" onMouseOut="hide_tip()"><img src="<%=rscase("CompHonor")%>" alt="成功案例" width="198" height="135" border="0" style="border: 2px solid #66CCFF"></a><br><a href="CaseBig.asp?id=<%=rscase("id")%>"><%=rscase("explain")%></a></td>
<%rscase.movenext
loop
end if
rscase.close%></tr></table>
</td><td id=demo2 valign=top>
</td></tr></table></div>
<script>
var speed=30
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>
<div id=demo style="overflow:hidden;height:170px;width:650px;">
<table align=left cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top><table align=left cellpadding=0 cellspace=0 border=0><tr> <%
set rscase=server.createobject("adodb.recordset")
sql="select top 5 * from CompHonor order by id desc"
rscase.open sql,conn,1,1
%><td valign="bottom" align="center"><a href="CaseBig.asp?id=<%=rscase("id")%>" onMouseMove="tip('<%=rscase("CompHonor")%>')" onMouseOut="hide_tip()"><img src="<%=rscase("CompHonor")%>" alt="成功案例" width="198" height="135" border="0" style="border: 2px solid #66CCFF"></a><br><a href="CaseBig.asp?id=<%=rscase("id")%>"><%=rscase("explain")%></a></td>
<%rscase.movenext
loop
end if
rscase.close%></tr></table>
</td><td id=demo2 valign=top>
</td></tr></table></div>
<script>
var speed=30
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>
参考资料: http://www.wantong68.com
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询