永发信息网

ASP网站内动态图片代码,是竖着下排的,我想让图片是横向排列,加无缝横向滚动的?谢谢帮忙 原代码如下:

答案:3  悬赏:40  手机版
解决时间 2021-03-07 03:45
  • 提问者网友:谁的错
  • 2021-03-06 05:07
<%
set rs3=server.CreateObject("ADODB.RecordSet")
if uselevel=1 then
if Request.cookies("key")="super" or Request.cookies("key")="typemaster" or Request.cookies("key")="bigmaster" or Request.cookies("key")="smallmaster" or Request.cookies("key")="check" then
rs3.Source ="select top " & top_img & " * from News where picnews=1 and checkked=1 and picname<>null order by NewsID DESC"
end if
if Request.cookies("key")="" then
rs3.Source ="select top " & top_img & " * from News where picnews=1 and checkked=1 and newslevel=0 and picname<>null order by NewsID DESC"
end if
if Request.cookies("key")="selfreg" then
if Request.cookies("reglevel")=3 then
rs3.Source ="select top " & top_img & " * from News where picnews=1 and checkked=1 and newslevel<=3 and picname<>null order by NewsID DESC"
end if
if Request.cookies("reglevel")=2 then
rs3.Source ="select top " & top_img & " * from News where picnews=1 and checkked=1 and newslevel<=2 and picname<>null order by NewsID DESC"
end if
if Request.cookies("reglevel")=1 then
rs3.Source ="select top " & top_img & " * from News where picnews=1 and checkked=1 and newslevel<=1 and picname<>null order by NewsID DESC"
end if
end if
else
rs3.Source ="select top " & top_img & " * from News where picnews=1 and checkked=1 and picname<>null order by NewsID DESC"
end if
rs3.Open rs3.Source,conn,1,1
if not rs3.EOF then
while not rs3.EOF
fileExt=lcase(getFileExtName(rs3("picname")))
Content=rs3("Content")
content=replace(content,"[[","<")
content=replace(content,"]]",">")
%>
<p><a class=middle href="ReadNews.asp?NewsID=<%=rs3("NewsID")%>" target=_blank title="<%=rs3("title")%>">
<%if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then%>
</a><a class=middle href="ReadNews.asp?NewsID=<%=rs3("NewsID")%>" target=_blank title="<%=rs3("title")%>"><img src="uploadfile/<%=rs3("picname")%>" width="160" height="100" class="border"></a><a class=middle href="ReadNews.asp?NewsID=<%=rs3("NewsID")%>" target=_blank title="<%=rs3("title")%>">
<%end if%>
<br>
<script>
//测字符串实际长度
String.prototype.Tlength = function(){var arr=this.match(/[^\x00-\xff]/ig);return this.length+(arr==null?0:arr.length);}

//字符串左取
String.prototype.left = function(num,mode){if(!/\d+/.test(num))return(this);var str = this.substr(0,num);if(!mode) return str;var n = str.Tlength() - str.length;num = num - parseInt(n/2);return this.substr(0,num);}

//开始左取
document.write("<%=rs3("title")%>".left(20,true));
//结束左取
</script>
</a>
<%
rs3.MoveNext
wend
else
Response.Write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"" style=""TABLE-LAYOUT: fixed""><tr><td width=100% align=center height=2 bgcolor="& r_main &">暂无</td></tr></table>"
end if
rs3.close
set rs3=nothing
%>
能否加一段无缝的从右到左的滚动代码?现在代码是显示四个图,我想要五个图怎么改?谢谢
最佳答案
  • 五星知识达人网友:北方的南先生
  • 2021-03-06 05:33
asp代码主要实现调用数据库信息,和显示几条,排版主要还是看html代码,你上边的代码主要看这段:
<%end if%>
<br>
<script>
//测字符串实际长度

这里有一个换行符<br>把这个去掉就行了,
至于滚动,利用简单的滚动字幕效果就行了.

<p><a class=middle href="ReadNews.asp?NewsID=<%=rs3("NewsID")%>" target=_blank title="<%=rs3("title")%>">
<%if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then%>
</a>
这段代码不对啊,好像是新闻标题,但是中间少了标题<%=rs3("title")%> 这上边有一个分段符<p>也要去掉.
全部回答
  • 1楼网友:拾荒鲤
  • 2021-03-06 06:46
asp代码主要实现调用数据库信息,和显示几条,排版主要还是看html代码,你上边的代码主要看这段: <%end if%> <script> //测字符串实际长度 这里有一个换行符 把这个去掉就行了, 至于滚动,利用简单的滚动字幕效果就行了.

" target=_blank title="<%=rs3("title")%>"> <%if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then%> 这段代码不对啊,好像是新闻标题,但是中间少了标题<%=rs3("title")%> 这上边有一个分段符

也要去掉.

  • 2楼网友:逃夭
  • 2021-03-06 05:54
无缝滚动只能通过CSS或者JS,JQ来实现了
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯