asp网页 图片从数据库读取,并横向从右往左滚动的代码怎么写?

asp网页 图片从数据库读取,并横向从右往左滚动的代码怎么写?,第1张

<div id="demo" style="overflow:hiddenwidth:700px">

<table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >

<tr><td valign=top bgcolor=ffffff id="marquePic1">

<table width='100%' border='0' cellspacing='0'><tr>

<% set rs= Server.CreateObject("ADODB.RecordSet")

sql="select top 8 topid,photoname,bigpic from zhi_rui_g_po order by topid desc" '数据表及调用的总图片

rs.open sql,conn,1,1

if rs.eof and rs.bof then

response.Write("暂无信息!")

else

i=0

do while not rs.eof%>

<td align="center">

<a href="xxxx.asp?id=<%=rs(0)%>" title="<%=rs(1)%>"><img width="50" height="50" src="<%=rs(2)%>"><br><br><%=left(rs(1),8)%></a></td>

<%

i=i+1

rs.movenext

if i mod 4=0 then response.write ("</tr>")'每行显示的图片数

loop

end if

rs.close

set rs=nothing%>

</table>

</td><td id=marquePic2 valign=top></td></tr>

</table></div>

<script type="text/javascript">

var speed=50

marquePic2.innerHTML=marquePic1.innerHTML

function Marquee(){

if(demo.scrollLeft>=marquePic1.scrollWidth){

demo.scrollLeft=0

}else{

demo.scrollLeft++

}

}

var MyMar=setInterval(Marquee,speed)

demo.onmouseover=function() {clearInterval(MyMar)}

demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}

</script>

</div>

begin --取钱 *** 作

BEGIN TRANSACTION

DECLARE @errorSum INT

SET @errorSum = 0

UPDATE cardInfo SET balance=balance-@blan1 WHERE cardID = @cardNo

SET @errorSum = @errorSum+@@error

INSERT INTO transInfo (transDate,cardID,transType,transMoney,remark) VALUES (DEFAULT,@cardNo,@type,@blan1,'该用户 是要取钱')

SET @errorSum = @errorSum+@@error

IF @errorSum<>0

BEGIN

PRINT '取钱失败'

ROLLBACK TRANSACTION --回滚

END

ELSE

BEGIN

print'取钱成功'

COMMIT TRANSACTION

END

end


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/9967402.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-03
下一篇 2023-05-03

发表评论

登录后才能评论

评论列表(0条)

保存