关于ASP滚动代码的修改
下面是一段自下而上的滚动文字,是由数据库读取的内容,现在我想修改为横向单条滚动信息,高度大概为26相素,横向连续不动的滚动。例如某某人说:如何如何……某某人2号说:如何如...
下面是一段自下而上的滚动文字,是由数据库读取的内容,现在我想修改为横向单条滚动信息,高度大概为26相素,横向连续不动的滚动。
例如 某某人说:如何如何…… 某某人2号说:如何如何……
其中display.asp?username=<%=rs("username")%>"是数据读取为用户,应该不用我详细解释了吧?将以下代码实现横向滚动就OK了,如果解决方案好,我还会给你加到50分!
</TABLE>
<TABLE WIDTH="771" HEIGHT="238" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0" BACKGROUND="images/05_26.gif">
<TR>
<TD WIDTH="11" ALIGN="center">
<MARQUEE DIRECTION="up" HEIGHT="200" ONMOUSEOUT="start();" ONMOUSEOVER="stop();" SCROLLAMOUNT="2" SCROLLDELAY="0" SCROLLTOP="SCROLLLEFT=0"></MARQUEE></TD>
<TD WIDTH="170" ALIGN="center"><%set rs=server.createobject("adodb.recordset")
rs.open "select top 10 * from love_aqxy order by addtime desc",conn,1,1
IF (rs.State =adStateClosed) or (rs.BOF=true and rs.EOF =true) or rs.RecordCount=0 THEN
RESPONSE.Write"<BR><BR> 暂无宣言。"
rs.close
ELSE
%>
<MARQUEE DIRECTION="Left" HEIGHT="31" ONMOUSEOUT="start();" ONMOUSEOVER="stop();" SCROLLAMOUNT="2" SCROLLDELAY="0" SCROLLTOP="SCROLLLEFT=0">
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0">
<%for a=1 to 10%>
<TR>
<TD WIDTH="20" ALIGN="right" VALIGN="Left">
<IMG SRC="images/x.gif" WIDTH="6" HEIGHT="6" HSPACE="6" VSPACE="5" ALIGN="absbottom"></TD>
<TD WIDTH="330" STYLE="line-height:140%;border-bottom:#C8F1FD 1px dotted;">
<A HREF="display.asp?username=<%=rs("username")%>" TARGET="_blank">
<U><FONT COLOR="#666666"><%=htmlout(ChkBadWords(rs("username")))%></FONT></U></A><FONT COLOR="FF5494">宣</FONT>:<%=htmlout(ChkBadWords(rs("content")))%></TD>
</TR>
<%
rs.movenext
if rs.eof then exit for
next
rs.close
END IF
%>
</TABLE></MARQUEE>
<TABLE WIDTH="75" HEIGHT="14" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD></TD>
</TR>
</TABLE>
<TABLE WIDTH="160" HEIGHT="27" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD WIDTH="114" ALIGN="center">
<A HREF="i_5.asp?submitok=addhtml">
<IMG SRC="images/fb2.gif" ALT="发布宣言<br><font color=red>加Love金币若干</font>" WIDTH="69" HEIGHT="21" BORDER="0"></A></TD>
<TD WIDTH="46" ALIGN="right"><A HREF="LoveSaid.asp">
<IMG SRC="images/05_more.gif" WIDTH="41" HEIGHT="11" BORDER="0"></A></TD>
</TR>
</TABLE>
还是不行,它们都粘在一起了,希望能获得完美点的方案,表格也顺便做好~~谢谢 展开
例如 某某人说:如何如何…… 某某人2号说:如何如何……
其中display.asp?username=<%=rs("username")%>"是数据读取为用户,应该不用我详细解释了吧?将以下代码实现横向滚动就OK了,如果解决方案好,我还会给你加到50分!
</TABLE>
<TABLE WIDTH="771" HEIGHT="238" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0" BACKGROUND="images/05_26.gif">
<TR>
<TD WIDTH="11" ALIGN="center">
<MARQUEE DIRECTION="up" HEIGHT="200" ONMOUSEOUT="start();" ONMOUSEOVER="stop();" SCROLLAMOUNT="2" SCROLLDELAY="0" SCROLLTOP="SCROLLLEFT=0"></MARQUEE></TD>
<TD WIDTH="170" ALIGN="center"><%set rs=server.createobject("adodb.recordset")
rs.open "select top 10 * from love_aqxy order by addtime desc",conn,1,1
IF (rs.State =adStateClosed) or (rs.BOF=true and rs.EOF =true) or rs.RecordCount=0 THEN
RESPONSE.Write"<BR><BR> 暂无宣言。"
rs.close
ELSE
%>
<MARQUEE DIRECTION="Left" HEIGHT="31" ONMOUSEOUT="start();" ONMOUSEOVER="stop();" SCROLLAMOUNT="2" SCROLLDELAY="0" SCROLLTOP="SCROLLLEFT=0">
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0">
<%for a=1 to 10%>
<TR>
<TD WIDTH="20" ALIGN="right" VALIGN="Left">
<IMG SRC="images/x.gif" WIDTH="6" HEIGHT="6" HSPACE="6" VSPACE="5" ALIGN="absbottom"></TD>
<TD WIDTH="330" STYLE="line-height:140%;border-bottom:#C8F1FD 1px dotted;">
<A HREF="display.asp?username=<%=rs("username")%>" TARGET="_blank">
<U><FONT COLOR="#666666"><%=htmlout(ChkBadWords(rs("username")))%></FONT></U></A><FONT COLOR="FF5494">宣</FONT>:<%=htmlout(ChkBadWords(rs("content")))%></TD>
</TR>
<%
rs.movenext
if rs.eof then exit for
next
rs.close
END IF
%>
</TABLE></MARQUEE>
<TABLE WIDTH="75" HEIGHT="14" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD></TD>
</TR>
</TABLE>
<TABLE WIDTH="160" HEIGHT="27" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD WIDTH="114" ALIGN="center">
<A HREF="i_5.asp?submitok=addhtml">
<IMG SRC="images/fb2.gif" ALT="发布宣言<br><font color=red>加Love金币若干</font>" WIDTH="69" HEIGHT="21" BORDER="0"></A></TD>
<TD WIDTH="46" ALIGN="right"><A HREF="LoveSaid.asp">
<IMG SRC="images/05_more.gif" WIDTH="41" HEIGHT="11" BORDER="0"></A></TD>
</TR>
</TABLE>
还是不行,它们都粘在一起了,希望能获得完美点的方案,表格也顺便做好~~谢谢 展开
3个回答
展开全部
MARQUEE的代码没什么错,但asp嵌套的位置错了。
以下是修改后的代码,看清楚开始和结束的位置,别贴错了。
</TABLE>
<TABLE WIDTH="771" HEIGHT="238" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0" BACKGROUND="images/05_26.gif">
<TR>
<TD WIDTH="11" ALIGN="center">
<MARQUEE DIRECTION="up" HEIGHT="200" ONMOUSEOUT="start();" ONMOUSEOVER="stop();" SCROLLAMOUNT="2" SCROLLDELAY="0" SCROLLTOP="SCROLLLEFT=0"></MARQUEE></TD>
<TD WIDTH="170" ALIGN="center"><%
set rs=server.createobject("adodb.recordset")
rs.open "select top 10 * from love_aqxy order by addtime desc",conn,1,1
IF (rs.State =adStateClosed) or (rs.BOF=true and rs.EOF =true) or rs.RecordCount=0 THEN
RESPONSE.Write"<BR><BR> 暂无宣言。"
rs.close
ELSE
%>
<MARQUEE DIRECTION="Left" HEIGHT="31" ONMOUSEOUT="start();" ONMOUSEOVER="stop();" SCROLLAMOUNT="2" SCROLLDELAY="0" SCROLLTOP="SCROLLLEFT=0">
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0">
<TR>
<%for a=1 to 10%>
<TD WIDTH="20" ALIGN="right" VALIGN="Left">
<IMG SRC="images/x.gif" WIDTH="6" HEIGHT="6" HSPACE="6" VSPACE="5" ALIGN="absbottom"></TD>
<TD WIDTH="330" STYLE="line-height:140%;border-bottom:#C8F1FD 1px dotted;">
<A HREF="display.asp?username=<%=rs("username")%>" TARGET="_blank">
<U><FONT COLOR="#666666"><%=htmlout(ChkBadWords(rs("username")))%></FONT></U></A><FONT COLOR="FF5494">宣</FONT>:<%=htmlout(ChkBadWords(rs("content")))%></TD>
<%
rs.movenext
if rs.eof then exit for
next
%>
</TR>
<%
rs.close
%>
</TABLE></MARQUEE>
<%
END IF
%>
<TABLE WIDTH="75" HEIGHT="14" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD></TD>
</TR>
</TABLE>
<TABLE WIDTH="160" HEIGHT="27" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD WIDTH="114" ALIGN="center">
<A HREF="i_5.asp?submitok=addhtml">
<IMG SRC="images/fb2.gif" ALT="发布宣言<br><font color=red>加Love金币若干</font>" WIDTH="69" HEIGHT="21" BORDER="0"></A></TD>
<TD WIDTH="46" ALIGN="right"><A HREF="LoveSaid.asp">
<IMG SRC="images/05_more.gif" WIDTH="41" HEIGHT="11" BORDER="0"></A></TD>
</TR>
</TABLE>
以下是修改后的代码,看清楚开始和结束的位置,别贴错了。
</TABLE>
<TABLE WIDTH="771" HEIGHT="238" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0" BACKGROUND="images/05_26.gif">
<TR>
<TD WIDTH="11" ALIGN="center">
<MARQUEE DIRECTION="up" HEIGHT="200" ONMOUSEOUT="start();" ONMOUSEOVER="stop();" SCROLLAMOUNT="2" SCROLLDELAY="0" SCROLLTOP="SCROLLLEFT=0"></MARQUEE></TD>
<TD WIDTH="170" ALIGN="center"><%
set rs=server.createobject("adodb.recordset")
rs.open "select top 10 * from love_aqxy order by addtime desc",conn,1,1
IF (rs.State =adStateClosed) or (rs.BOF=true and rs.EOF =true) or rs.RecordCount=0 THEN
RESPONSE.Write"<BR><BR> 暂无宣言。"
rs.close
ELSE
%>
<MARQUEE DIRECTION="Left" HEIGHT="31" ONMOUSEOUT="start();" ONMOUSEOVER="stop();" SCROLLAMOUNT="2" SCROLLDELAY="0" SCROLLTOP="SCROLLLEFT=0">
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0">
<TR>
<%for a=1 to 10%>
<TD WIDTH="20" ALIGN="right" VALIGN="Left">
<IMG SRC="images/x.gif" WIDTH="6" HEIGHT="6" HSPACE="6" VSPACE="5" ALIGN="absbottom"></TD>
<TD WIDTH="330" STYLE="line-height:140%;border-bottom:#C8F1FD 1px dotted;">
<A HREF="display.asp?username=<%=rs("username")%>" TARGET="_blank">
<U><FONT COLOR="#666666"><%=htmlout(ChkBadWords(rs("username")))%></FONT></U></A><FONT COLOR="FF5494">宣</FONT>:<%=htmlout(ChkBadWords(rs("content")))%></TD>
<%
rs.movenext
if rs.eof then exit for
next
%>
</TR>
<%
rs.close
%>
</TABLE></MARQUEE>
<%
END IF
%>
<TABLE WIDTH="75" HEIGHT="14" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD></TD>
</TR>
</TABLE>
<TABLE WIDTH="160" HEIGHT="27" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD WIDTH="114" ALIGN="center">
<A HREF="i_5.asp?submitok=addhtml">
<IMG SRC="images/fb2.gif" ALT="发布宣言<br><font color=red>加Love金币若干</font>" WIDTH="69" HEIGHT="21" BORDER="0"></A></TD>
<TD WIDTH="46" ALIGN="right"><A HREF="LoveSaid.asp">
<IMG SRC="images/05_more.gif" WIDTH="41" HEIGHT="11" BORDER="0"></A></TD>
</TR>
</TABLE>
展开全部
要用滚动,简单点的用Marquee标签就行了。
具体的参数DREAMWAVER都有。
你也可以参考这里的属性。
http://www.phpx.com/man/dhtmlcn/objects/MARQUEE.html
具体的参数DREAMWAVER都有。
你也可以参考这里的属性。
http://www.phpx.com/man/dhtmlcn/objects/MARQUEE.html
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个本来 不就是横向的么??
!!!!!??
!!!!!??
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询