急急急!!谁能给我一个绑定了数据库的图片滚动代码,asp.net的,最好是直接给我页面,谢谢了,急啊,跪求
因为我确实是比较急,谢谢了,我的邮箱是liuzhen@163.com晕邮箱错了,是itliuzhen@163.com...
因为我确实是比较急,谢谢了,我的邮箱是liuzhen@163.com
晕
邮箱错了,是itliuzhen@163.com 展开
晕
邮箱错了,是itliuzhen@163.com 展开
1个回答
展开全部
<Script Language="JavaScript">
<!--
function SlidePic(ID) {this.ID=ID; this.Width=0;this.Height=0; this.TimeOut=5000; this.Effect=23; this.TitleLen=0; this.PicNum=-1; this.Img=null; this.Url=null; this.Title=null; this.AllPic=new Array(); this.Add=AddSlidePic; this.Show=ShowSlidePic; this.LoopShow=LoopShowSlidePic;}
function NewSlide() {this.ImgUrl=""; this.LinkUrl=""; this.Title="";}
function AddSlidePic(SP) {this.AllPic[this.AllPic.length] = SP;}
function ShowSlidePic() {
if(this.AllPic[0] == null) return false;
document.write('<div align="center"><a id="Url' + this.ID + '" href="" target=_blank><img id="Img' + this.ID + '" style="width:' + this.Width + '; height:' + this.Height + '; filter: revealTrans(duration=2,transition=23);" src="javascript:null" border="0"></a>');
if(this.TitleLen != 0) document.write("<br><Div id='Title" + this.ID + "'></Div></div>");
this.Img = document.getElementById("Img" + this.ID);
this.Url = document.getElementById("Url" + this.ID);
this.Title = document.getElementById("Title" + this.ID);
this.LoopShow();
}
function LoopShowSlidePic() {
if(this.PicNum<this.AllPic.length-1) this.PicNum++ ;
else this.PicNum=0;
this.Img.filters.revealTrans.Transition=this.Effect;
this.Img.filters.revealTrans.apply();
this.Img.src=this.AllPic[this.PicNum].ImgUrl;
this.Img.filters.revealTrans.play();
this.Url.href=this.AllPic[this.PicNum].LinkUrl;
if(this.Title) this.Title.innerHTML='<a href="'+this.AllPic[this.PicNum].LinkUrl+'" >'+this.AllPic[this.PicNum].Title+'</a>';
this.Img.timer=setTimeout(this.ID+".LoopShow()",this.TimeOut);
}
var SlidePic = new SlidePic("SlidePic");
SlidePic.Width = 150; //这是图片宽度,修改成你需要的值
SlidePic.Height = 120; //这是图片高度 ,修改成你需要的值
SlidePic.TimeOut = 5000; //延迟时间 ,修改成你需要的值
SlidePic.Effect = 23;
SlidePic.TitleLen = 1;
<%
'幻灯片新闻代码
sql="select top 3 * from picnews order by id desc" //数据库字段 ,修改成你需要的值。支持数据库调用
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
k=1
Num_total=rs.recordcount
for i=1 to Num_total
%>
var NewItem = new NewSlide();
NewItem.ImgUrl = '<%=rs("News_pic")%>'; //图片地址
NewItem.LinkUrl= '<%=rs("News_url")%>'; //链接地址
NewItem.Title = '<span><%=rs("title")%></span>'; //新闻标题
SlidePic.Add(NewItem);
<%
rs.movenext
k=k+1
'loop
next
else
response.write "暂无图片新闻"
end if
%>
SlidePic.Show();
//-->
</Script>
<!--
function SlidePic(ID) {this.ID=ID; this.Width=0;this.Height=0; this.TimeOut=5000; this.Effect=23; this.TitleLen=0; this.PicNum=-1; this.Img=null; this.Url=null; this.Title=null; this.AllPic=new Array(); this.Add=AddSlidePic; this.Show=ShowSlidePic; this.LoopShow=LoopShowSlidePic;}
function NewSlide() {this.ImgUrl=""; this.LinkUrl=""; this.Title="";}
function AddSlidePic(SP) {this.AllPic[this.AllPic.length] = SP;}
function ShowSlidePic() {
if(this.AllPic[0] == null) return false;
document.write('<div align="center"><a id="Url' + this.ID + '" href="" target=_blank><img id="Img' + this.ID + '" style="width:' + this.Width + '; height:' + this.Height + '; filter: revealTrans(duration=2,transition=23);" src="javascript:null" border="0"></a>');
if(this.TitleLen != 0) document.write("<br><Div id='Title" + this.ID + "'></Div></div>");
this.Img = document.getElementById("Img" + this.ID);
this.Url = document.getElementById("Url" + this.ID);
this.Title = document.getElementById("Title" + this.ID);
this.LoopShow();
}
function LoopShowSlidePic() {
if(this.PicNum<this.AllPic.length-1) this.PicNum++ ;
else this.PicNum=0;
this.Img.filters.revealTrans.Transition=this.Effect;
this.Img.filters.revealTrans.apply();
this.Img.src=this.AllPic[this.PicNum].ImgUrl;
this.Img.filters.revealTrans.play();
this.Url.href=this.AllPic[this.PicNum].LinkUrl;
if(this.Title) this.Title.innerHTML='<a href="'+this.AllPic[this.PicNum].LinkUrl+'" >'+this.AllPic[this.PicNum].Title+'</a>';
this.Img.timer=setTimeout(this.ID+".LoopShow()",this.TimeOut);
}
var SlidePic = new SlidePic("SlidePic");
SlidePic.Width = 150; //这是图片宽度,修改成你需要的值
SlidePic.Height = 120; //这是图片高度 ,修改成你需要的值
SlidePic.TimeOut = 5000; //延迟时间 ,修改成你需要的值
SlidePic.Effect = 23;
SlidePic.TitleLen = 1;
<%
'幻灯片新闻代码
sql="select top 3 * from picnews order by id desc" //数据库字段 ,修改成你需要的值。支持数据库调用
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
k=1
Num_total=rs.recordcount
for i=1 to Num_total
%>
var NewItem = new NewSlide();
NewItem.ImgUrl = '<%=rs("News_pic")%>'; //图片地址
NewItem.LinkUrl= '<%=rs("News_url")%>'; //链接地址
NewItem.Title = '<span><%=rs("title")%></span>'; //新闻标题
SlidePic.Add(NewItem);
<%
rs.movenext
k=k+1
'loop
next
else
response.write "暂无图片新闻"
end if
%>
SlidePic.Show();
//-->
</Script>
追问
额
为什么你给的代码,我放到页面里就报错啊,36个呢,你能不能把这写好个页面发到我的邮箱啊,谢谢,我是真急啊
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询