ASP纵向图片滚动改成横向滚动怎么操作
<%setrs_Product=server.createobject("adodb.recordset")sqltext="selecttop10*fromProduc...
<%
set rs_Product=server.createobject("adodb.recordset")
sqltext="select top 10 * from Product where Passed=True And Elite=True order by UpdateTime desc"
rs_Product.open sqltext,conn,1,1
%>
<marquee direction=up TrueSpeed scrollAmount=1 scrollDelay=40 height=110 onMouseOut=this.start(); onMouseOver=this.stop();>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
<%row_count=1 %>
<tr align="center">
<% Do While Not rs_Product.EOF%>
<td><table width="105%" height="98" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href="ArticleShow.asp?ArticleID=<%=rs_Product("articleid")%>"><img src=<%=rs_Product("DefaultPicUrl")%> alt="首页装饰|装潢设计" width=124 height=102 border=0></a></div></td>
</tr>
<tr>
<td height="39" align="center"><a href="ArticleShow.asp?ArticleID=<%=rs_Product("articleid")%>"><%=rs_Product("Title")%></a></td>
</tr>
</table></td>
<%if row_count mod 5 <>0 then%>
<%end if%>
<% if row_count mod 5 =0 then%>
</tr>
<tr>
<%end if%>
<%
rs_Product.MoveNext
row_count=row_count+1
Loop
rs_Product.close
%> 展开
set rs_Product=server.createobject("adodb.recordset")
sqltext="select top 10 * from Product where Passed=True And Elite=True order by UpdateTime desc"
rs_Product.open sqltext,conn,1,1
%>
<marquee direction=up TrueSpeed scrollAmount=1 scrollDelay=40 height=110 onMouseOut=this.start(); onMouseOver=this.stop();>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
<%row_count=1 %>
<tr align="center">
<% Do While Not rs_Product.EOF%>
<td><table width="105%" height="98" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href="ArticleShow.asp?ArticleID=<%=rs_Product("articleid")%>"><img src=<%=rs_Product("DefaultPicUrl")%> alt="首页装饰|装潢设计" width=124 height=102 border=0></a></div></td>
</tr>
<tr>
<td height="39" align="center"><a href="ArticleShow.asp?ArticleID=<%=rs_Product("articleid")%>"><%=rs_Product("Title")%></a></td>
</tr>
</table></td>
<%if row_count mod 5 <>0 then%>
<%end if%>
<% if row_count mod 5 =0 then%>
</tr>
<tr>
<%end if%>
<%
rs_Product.MoveNext
row_count=row_count+1
Loop
rs_Product.close
%> 展开
2个回答
展开全部
下面的是我正在使用的代码,刚好符合你的要求。共享给你吧:
<div id=demo style=overflow:hidden;height:143;width:550;color:#ffffff>
<table border="0" VALIGN=TOP>
<tr>
<td id=demo1 valign="top">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgColor=#ffffff>
<%sql="select top 10 title,writer,content,articleid,state,coolyes,hits from article where state='yes' and coolyes='1' order by articleid desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write"<IMG src='images/sorry.gif' alt='更多推荐还没有任何链接哦'>"
else
do while not rs.eof
%>
<td Valign="left" align="middle">
<a target="_blank" title='' href="list.asp?id=<%=rs("articleid")%>"><%=left(rs("content"),60)%> "0" class="img"></a><br> </DIV>
<a href="list.asp?id=<%=rs("articleid")%>" title=''><DIV align=center><%=left(rs("title"),7)%></DIV></a>
</td>
<%
rs.movenext
loop
end if
rs.close
%>
</tr>
</table></td><td id=demo2 valign=top></td>
</tr>
</table></div>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML
demo.scrollLeft=demo.scrollWidth
function Marquee(){
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.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:143;width:550;color:#ffffff>
<table border="0" VALIGN=TOP>
<tr>
<td id=demo1 valign="top">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgColor=#ffffff>
<%sql="select top 10 title,writer,content,articleid,state,coolyes,hits from article where state='yes' and coolyes='1' order by articleid desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write"<IMG src='images/sorry.gif' alt='更多推荐还没有任何链接哦'>"
else
do while not rs.eof
%>
<td Valign="left" align="middle">
<a target="_blank" title='' href="list.asp?id=<%=rs("articleid")%>"><%=left(rs("content"),60)%> "0" class="img"></a><br> </DIV>
<a href="list.asp?id=<%=rs("articleid")%>" title=''><DIV align=center><%=left(rs("title"),7)%></DIV></a>
</td>
<%
rs.movenext
loop
end if
rs.close
%>
</tr>
</table></td><td id=demo2 valign=top></td>
</tr>
</table></div>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML
demo.scrollLeft=demo.scrollWidth
function Marquee(){
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
楼主试着修改direction=left试试
direction属性
文字滚动的方向,属性的参数值有down、left、right、up共四个单一可选值,分别代表滚动方向向下、向左、向右、向上。如下所示:
<marquee direction="right">我向右滚动</marquee>
我向右滚动
<marquee direction="down">我向下滚动</marquee>
direction属性
文字滚动的方向,属性的参数值有down、left、right、up共四个单一可选值,分别代表滚动方向向下、向左、向右、向上。如下所示:
<marquee direction="right">我向右滚动</marquee>
我向右滚动
<marquee direction="down">我向下滚动</marquee>
更多追问追答
追问
我有修改,但是现在成两行滚动,怎么设置一行呢,还有怎么改变这一行中的数据
追答
因为你的table有多行,改成一行试试
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询