[心缘地方]同学录
首页 | 功能说明 | 站长通知 | 最近更新 | 编码查看转换 | 代码下载 | 常见问题及讨论 | 《深入解析ASP核心技术》 | 王小鸭自动发工资条VBA版
登录系统:用户名: 密码: 如果要讨论问题,请先注册。
发表人 主题:想实现些效果,站长请进
993
身份:user
发帖:53
登陆次数:53
1F 发表于 2007/4/20 15:41:07
在经典上玩,发现个好代码,不知道是否能加在咱们同学录上呢?

1、图片轮换

使用:可以用于首页面轮换所有相片的小图(要不总是那三个有点单调)

效果演示地址:

http://bbs.blueidea.com/thread-2486328-2-1.html

第55楼

源码:


<SCRIPT language=JavaScript>
var dde_para = new Array();
var dde_aa   = new Array();
var dde_url  = document.location.href;
var dde_pp   = dde_url.split("#")[1];
var jspfile  = 1;
var para     = null;

//滚动页面的宽
var scrollwidth = 705;

//滚动页面的高
var scrollheight = 120;

if(dde_pp!=null && dde_pp.length>0){
  dde_para = dde_pp.split("&");}
  for(i=0; dde_para!=null && i<dde_para.length;i++){
  dde_aa = dde_para[i].split("=");
  eval("var "+dde_aa[0] +"=''"+dde_aa[1]+"''");}
var car_num = 5;
var i=1;
//默认滚动时间10秒
var pausebetweenimages=800 * 8;
var slideimages=new Array();
//滚动页面1的URL
slideimages[0]="<iframe border=0 vspace=0 hspace=0 bgcolor=#888888 Name=union163com align=center marginwidth=0 marginheight=0 framespacing=0 frameborder=0 scrolling=no width="+scrollwidth+" height="+scrollheight+" src=''http://news.qq.com/photon/08photojdlm1.htm''></iframe>";
//滚动页面2的URL
slideimages[1]="<iframe border=0 vspace=0 hspace=0 bgcolor=#888888 Name=union163com align=center marginwidth=0 marginheight=0 framespacing=0 frameborder=0 scrolling=no width="+scrollwidth+" height="+scrollheight+" src=''http://news.qq.com/photon/08photojdlm2.htm''></iframe>";
function move1(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=car_num){
tdiv.style.pixelTop=0
setTimeout("move1(tdiv)",pausebetweenimages)
setTimeout("move2(second2)",pausebetweenimages)
return}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=car_num
setTimeout("move1(tdiv)",50)}
else{
tdiv.style.pixelTop=scrollheight
tdiv.innerHTML=slideimages[0]
if (i==slideimages.length-1)
i=0
else i++}}
function move2(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=car_num){
tdiv2.style.pixelTop=0
setTimeout("move2(tdiv2)",pausebetweenimages)
setTimeout("move1(first2)",pausebetweenimages)
return}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=car_num
setTimeout("move2(second2)",50)}
else{
tdiv2.style.pixelTop=scrollheight
tdiv2.innerHTML=slideimages[1]
if (i==slideimages.length-1)
i=0
else i++}}
function conmouse(){car_num=0;}
function cmouseout(){car_num=5;}
function startscroll(){
if (document.all){
move1(first2)
second2.style.top=scrollheight
}
else if (document.layers){
move1(document.main.document.first)
document.main.document.second.top=scrollheight+5
document.main.document.second.visibility=''show''}}
//-->
</SCRIPT>
  <ILAYER id=main height="&{scrollheight};" 
      width="&{scrollwidth};">
  <LAYER name="first" left="0" 
      top="1" width="&{scrollwidth};" id=first>
  <SCRIPT language=JavaScript1.2>
if (document.layers)
document.write(slideimages[0])
</SCRIPT>
  </LAYER>
  <LAYER id=second width="&{scrollwidth};" top="0" left="0" 
      visibility="hide">
  <SCRIPT language=JavaScript1.2>
if (document.layers)
document.write(slideimages[1])
</SCRIPT>
  </LAYER>
  </ILAYER>
  <script language=JavaScript1.2> 
if (document.all){
document.writeln(''<span id="main2" style="position:relative;width:''+scrollwidth+'';height:''+scrollheight+'';overflow:hiden;background-color:#ffffff">'')
document.writeln(''<div onMouseOver="conmouse()" onMouseOut="cmouseout()" style="position:absolute;width:''+scrollwidth+'';height:''+scrollheight+'';clip:rect(0 ''+scrollwidth+'' ''+scrollheight+'' 0);left:0;top:0">'')
document.writeln(''<div id="first2" style="position:absolute;width:''+scrollwidth+'';left:0;top:1;">'')
document.write(slideimages[0])
document.writeln(''</div>'')
document.writeln(''<div id="second2" style="position:absolute;width:''+scrollwidth+'';left:0;top:0">'')
document.write(slideimages[1])
document.writeln(''</div>'')
document.writeln(''</div>'')
document.writeln(''</span>'')}
startscroll();
</script>



hayfeng
身份:user
发帖:80
登陆次数:72
2F 发表于 2007/4/20 19:10:16
强烈支持,我一直在弄,就是弄不出来,调用不出来,网上找的flash轮换效果都是静态的,不知如何从数据库中把动态图片调用出来,请管理员帮忙研究一下,急切需要,在线等。

993
身份:user
发帖:53
登陆次数:53
3F 发表于 2007/4/20 20:55:43
找到知音了,呵呵。
管理员~~~~~~~~~~~~~~~~~~~~呼叫   管理员~~~~~~~~~~~~~

hayfeng
身份:user
发帖:80
登陆次数:72
4F 发表于 2007/4/21 12:56:15
找到一个代码,但就是不行,老大,帮忙解决一下阿!
动态幻灯片效果,我们通常能通过查看源代码文件看到这种效果的代码,一种javascript的代码,能否将图片和图片的连接地址用动态的程序来操作.现以asp语言讲述这种效果的制作.

首先呢,要书写asp代码片段,范例如下
<%
set rs = server.CreateObject ("adodb.recordset")
sql = "select  top 3 * from picnews where ifshow=1"
rs.open sql,conn,1,1

         pic1=rs("imgurl")
         link1=rs("piclink")
         rs.movenext

         pic2=rs("imgurl")
         link2=rs("piclink")
         rs.movenext

         link3=rs("picurl")   
         pic3=rs("imglink")    
         rs.close
         set rs=nothing 
%>
                    
该代码片段的作用是用来定义三张图片和三个片对应的连接,比较简单

然后书写javascript代码片段,把三个图片的地址和连接目标用以上的三个变量分别替换出来

<script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
imgUrl[1]="<%=pic1%>";
imgLink[1]="<%=link1%>";
imgUrl[2]="<%=pic2%>";
imgLink[2]="<%=link2%>";
imgUrl[3]="<%=pic3%>";
imgLink[3]="<%=link3%>";
var imgPre=new Array();
var j=0;
for (i=1;i<=3;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="") ) {
  j++;
} else {
  break;
}
}
function playTran(){
if (document.all){
  document.imgInit.filters[0].play();
}
}
function nextAd(){
if(adNum<j)adNum++ ;
else adNum=1;
if (document.all){
  document.imgInit.filters[0].Transition=26;
  document.imgInit.filters[0].apply();
}
document.images.imgInit.src="/imgUrl[adNum]";
playTran();
theTimer=setTimeout("nextAd()", 4000); //两秒周期 循环调用本身( nextAd() )
}
function goUrl(){
jumpUrl=imgLink[adNum];
jumpTarget=''_blank'';
if (jumpUrl != ''''){
  if (jumpTarget != '''')  //相当于a标签的target属性,如果有指定则新开窗口
   window.open(jumpUrl,jumpTarget);
  else //没有指定target属性则在本窗口打开
   location.href="/jumpUrl";
}
}
</script>

最后一步,就是在需要的位置来调用这个图片效果了

<a href="javascript:goUrl()"><img style="border: 1 solid #000000; padding: 1;FILTER: progid:DXImageTransform.Microsoft.RevealTrans (duration=1,transition=3);
; border-color:#000000;color:#000000;margin-bottom:0px" src="javascript:nextAd()" width="156" height="190" border=0 name=imgInit>  

这样,一个动态幻灯片效果就被做出来了!


嘎嘎,是我
身份:admin
发帖:1435
登陆次数:3222
5F 发表于 2007/4/23 15:36:29
首页没敢显示太多,怕有的人不支持缩略图组件,显示太多会很慢的。

hayfeng
身份:user
发帖:80
登陆次数:72
6F 发表于 2007/4/24 19:12:25
如果要实现动态幻灯片显示图片怎么实现阿?拜托看一下上面的代码帮忙解决一下!

嘎嘎,是我
身份:admin
发帖:1435
登陆次数:3222
7F 发表于 2007/4/25 0:03:50
大概这样:

<script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
<%
sql="select top 3 P.photoID,P.photoFilename,U.realName from TBL_Photo P inner join TBL_USER U on U.userName=P.userName where P.locked='no' order by P.photoID desc"
rs.open sql,conn,0,1 
count=1
do while not rs.eof
    response.write "imgUrl[" & count & "]='" & getPhotoURL(rs("photoFilename")) & "';"
    response.write "imgLink[" & count &" ]='photo_viewphoto.asp?photoID=" & rs("photoID") & "';"

    count=count+1
    rs.movenext
loop
rs.close
%>
var imgPre=new Array();
var j=0;
for (i=1;i<=3;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="") ) {
  j++;
} else {
  break;
}
}
...........后面那些

hayfeng
身份:user
发帖:80
登陆次数:72
8F 发表于 2007/4/25 11:18:32
试过了,不行哦,这个是要加到哪里的?能弄完整吗?

嘎嘎,是我
身份:admin
发帖:1435
登陆次数:3222
9F 发表于 2007/4/25 22:59:07
try了下,可以了,就放在首页的最新照片那里。


<script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
<%
sql="select top 3 P.photoID,P.photoFilename,U.realName from TBL_Photo P inner join TBL_USER U on U.userName=P.userName where P.locked='no' order by P.photoID desc"
rs.open sql,conn,0,1 
count=1
do while not rs.eof
    response.write "imgUrl[" & count & "]='" & getPhotoURL(rs("photoFilename")) & "';"
    response.write "imgLink[" & count &"]='photo_viewphoto.asp?photoID=" & rs("photoID") & "';"

    count=count+1
    rs.movenext
loop
rs.close
%>
var imgPre=new Array();
var j=0;
for (i=1;i<=3;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="") ) {
  j++;
} else {
  break;
}
}
function playTran(){
if (document.all){
  document.imgInit.filters[0].play();
}
}
function nextAd(){
if(adNum<j)adNum++ ;
else adNum=1;
if (document.all){
  document.imgInit.filters[0].Transition=26;
  document.imgInit.filters[0].apply();
}
document.images.imgInit.src=imgUrl[adNum];
playTran();
theTimer=setTimeout("nextAd()", 4000); //两秒周期 循环调用本身( nextAd() )
}
function goUrl(){
jumpUrl=imgLink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
  if (jumpTarget != '')  //相当于a标签的target属性,如果有指定则新开窗口
   window.open(jumpUrl,jumpTarget);
  else //没有指定target属性则在本窗口打开
   location.href=jumpUrl;
}
}
</script>
<a href="javascript:goUrl()"><img style="border: 1 solid #000000; padding: 1;FILTER: progid:DXImageTransform.Microsoft.RevealTrans (duration=1,transition=3);
; border-color:#000000;color:#000000;margin-bottom:0px" src="javascript:nextAd()" width="156" height="190" border=0 name=imgInit>  



hayfeng
身份:user
发帖:80
登陆次数:72
10F 发表于 2007/4/26 0:03:22
老大就是厉害,现在是可以。但是怎么没有没有像网上那些图片轮换那样在图片下方有1,2,3,4之类的标签可以点击呢?要怎么加进去呢?就像这样的效果http://www.pconline.com.cn/pcedu/

hayfeng
身份:user
发帖:80
登陆次数:72
11F 发表于 2007/4/27 11:55:49
我用了一个ASP动态调用图片幻灯片效果,是flash的,我是想在首页最新照片里用ifram框架包含这个ASP动态调用图片幻灯片效果,但不行。麻烦帮忙看看,其中的动态文件如下,我修改了一部分,出现这样的错误
技术信息(用于支持人员)

错误类型:
ADODB.Recordset (0x800A0CC1)
在对应所需名称或序数的集合中,未找到项目。
/03xy/pic.asp, 第 17 行
具体代码如下,请问要怎么改:


<!--#include File="conn.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ASP动态调用图片幻灯片效果</title>
</head>
<%
set rs = server.CreateObject ("adodb.recordset")
sql="select top 3 P.photoID,P.photoFilename,U.realName from TBL_Photo P inner join TBL_USER U on U.userName=P.userName where P.locked=''no'' order by P.photoID desc"
''有图文章的调用:select top 几条 * from 数据库名 where 字段名 =1 order by id 降序"
''注:一般数据库会有一个字段表明是否有图 如:pic=1 表示该文有图,所以上面写成 where pic = 1
rs.open sql,conn,1,1
         ''将每条记录的值分别赋给新变量(将字段名修改为您数据库对应字段的名称)
         pic1=rs("photoFilename")
         link1=rs("photoID")
         text1=rs("photoTitle")
         ''移动到下一条记录
         rs.movenext
         pic2=rs("photoFilename")
         link2=rs("photoID")
         text2=rs("photoTitle")
         rs.movenext
         pic3=rs("photoFilename")
         link3=rs("photoID")
         text3=rs("photoTitle") 
         rs.movenext        
         pic4=rs("photoFilename")
         link4=rs("photoID")
         text4=rs("photoTitle")
         rs.movenext
         pic5=rs("photoFilename")
         link5=rs("photoID")
         text5=rs("photoTitle")
         ''关闭记录集
         rs.close
         set rs=nothing
         conn.close
         set conn=nothing
%>
<body>
<a target=_self href="javascript:goUrl()"> <span class="f14b"> 
<script type="text/javascript">
imgUrl1="<%=pic1%>";
imgtext1="<%=text1%>"
imgLink1=escape("<%=url1%>");
imgUrl2="<%=pic2%>";
imgtext2="<%=text2%>"
imgLink2=escape("<%=url2%>");
imgUrl3="<%=pic3%>";
imgtext3="<%=text3%>"
imgLink3=escape("<%=url3%>");
imgUrl4="<%=pic4%>";
imgtext4="<%=text4%>"
imgLink4=escape("<%=url4%>");
imgUrl5="<%=pic5%>";
imgtext5="<%=text5%>"
imgLink5=escape("<%=url5%>");

// 自定义Flash的宽度、高度,以及文字高度
 var focus_width=290
 var focus_height=148
 var text_height=18
 var swf_height = focus_height+text_height
 
 var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
 var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
 var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
 
 document.write(''<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="''+ focus_width +''" height="''+ swf_height +''">'');
 document.write(''<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">'');
 document.write(''<param name="menu" value="false"><param name=wmode value="opaque">'');
 document.write(''<param name="FlashVars" value="pics=''+pics+''&links=''+links+''&texts=''+texts+''&borderwidth=''+focus_width+''&borderheight=''+focus_height+''&textheight=''+text_height+''">'');
 document.write(''<embed src="pixviewer.swf" wmode="opaque" FlashVars="pics=''+pics+''&links=''+links+''&texts=''+texts+''&borderwidth=''+focus_width+''&borderheight=''+focus_height+''&textheight=''+text_height+''" menu="false" bgcolor="#F0F0F0" quality="high" width="''+ focus_width +''" height="''+ focus_height +''" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'');  document.write(''</object>'');
 </script>
</span></a><span id=focustext class=f14b> </span> 
</body>
</html>



嘎嘎,是我
身份:admin
发帖:1435
登陆次数:3222
12F 发表于 2007/4/27 12:08:30
加上就行了。
sql="select top 3 P.photoID,P.photoTitle,P.photoFilename,U.realName from TBL_Photo...

hayfeng
身份:user
发帖:80
登陆次数:72
13F 发表于 2007/4/27 19:31:38
我改成下面那样,页面可以显示出来,但图片不能显示出来。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
   ''以下为数据库连接语段
   on error resume next
   connstr="DBQ="+server.mappath("DATA/abcd.asp")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
   set conn=server.createobject("ADODB.CONNECTION")
   conn.open connstr
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ASP动态调用图片幻灯片效果</title>
</head>
<%
set rs = server.CreateObject ("adodb.recordset")
sql="select top 3 P.photoID,P.photoTitle,P.photoFilename,U.realName  from TBL_Photo P inner join TBL_USER U on U.userName=P.userName where P.locked=''no'' order by P.photoID desc"
''有图文章的调用:select top 几条 * from 数据库名 where 字段名 =1 order by id 降序"
''注:一般数据库会有一个字段表明是否有图 如:pic=1 表示该文有图,所以上面写成 where pic = 1
rs.open sql,conn,1,1
         ''将每条记录的值分别赋给新变量(将字段名修改为您数据库对应字段的名称)
         pic1=rs("P.photoFilename")
         link1=rs("P.photoID")
         text1=rs("P.photoTitle")
         ''移动到下一条记录
         rs.movenext
         pic2=rs("P.photoFilename")
         link2=rs("P.photoID")
         text2=rs("P.photoTitle")
         rs.movenext
         pic3=rs("P.photoFilename")
         link3=rs("P.photoID")
         text3=rs("P.photoTitle") 
         rs.movenext        
         pic4=rs("P.photoFilename")
         link4=rs("P.photoID")
         text4=rs("P.photoTitle")
         rs.movenext
         pic5=rs("P.photoFilename")
         link5=rs("P.photoID")
         text5=rs("P.photoTitle")
         ''关闭记录集
         rs.close
         set rs=nothing
         conn.close
         set conn=nothing
%>
<body>
<a target=_self href="javascript:goUrl()"> <span class="f14b"> 
<script type="text/javascript">
imgUrl1="<%=pic1%>";
imgtext1="<%=text1%>"
imgLink1=escape("<%=url1%>");
imgUrl2="<%=pic2%>";
imgtext2="<%=text2%>"
imgLink2=escape("<%=url2%>");
imgUrl3="<%=pic3%>";
imgtext3="<%=text3%>"
imgLink3=escape("<%=url3%>");
imgUrl4="<%=pic4%>";
imgtext4="<%=text4%>"
imgLink4=escape("<%=url4%>");
imgUrl5="<%=pic5%>";
imgtext5="<%=text5%>"
imgLink5=escape("<%=url5%>");

// 自定义Flash的宽度、高度,以及文字高度
 var focus_width=290
 var focus_height=148
 var text_height=18
 var swf_height = focus_height+text_height
 
 var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
 var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
 var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
 
 document.write(''<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="''+ focus_width +''" height="''+ swf_height +''">'');
 document.write(''<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">'');
 document.write(''<param name="menu" value="false"><param name=wmode value="opaque">'');
 document.write(''<param name="FlashVars" value="pics=''+pics+''&links=''+links+''&texts=''+texts+''&borderwidth=''+focus_width+''&borderheight=''+focus_height+''&textheight=''+text_height+''">'');
 document.write(''<embed src="pixviewer.swf" wmode="opaque" FlashVars="pics=''+pics+''&links=''+links+''&texts=''+texts+''&borderwidth=''+focus_width+''&borderheight=''+focus_height+''&textheight=''+text_height+''" menu="false" bgcolor="#F0F0F0" quality="high" width="''+ focus_width +''" height="''+ focus_height +''" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'');  document.write(''</object>'');
 </script>
</span></a><span id=focustext class=f14b> </span> 
</body>
</html>



嘎嘎,是我
身份:admin
发帖:1435
登陆次数:3222
14F 发表于 2007/4/28 9:27:16
pic1="upfile/" & rs("P.photoFilename")
..


hayfeng
身份:user
发帖:80
登陆次数:72
15F 发表于 2007/4/28 11:54:24
晕了,还是不行,能帮忙测试一下吗?成功后再把源码贴出来!
源文件文件在这里http://www.nhbgy.cn/pic.rar

嘎嘎,是我
身份:admin
发帖:1435
登陆次数:3222
16F 发表于 2007/4/28 14:30:53
<%@ CODEPAGE="936"%>
<!--#include File="conn.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<%
set rs = server.CreateObject ("adodb.recordset")
sql="select top 3 P.photoID,P.photoTitle,P.photoFilename,U.realName  from TBL_Photo P inner join TBL_USER U on U.userName=P.userName where P.locked='no' order by P.photoID desc"
'有图文章的调用:select top 几条 * from 数据库名 where 字段名 =1 order by id 降序"
'注:一般数据库会有一个字段表明是否有图 如:pic=1 表示该文有图,所以上面写成 where pic = 1
rs.open sql,conn,0,1
         '将每条记录的值分别赋给新变量(将字段名修改为您数据库对应字段的名称)
         if not rs.eof then
             pic1="upfile/" & rs("photoFilename")
             link1=rs("photoID")
             text1=rs("photoTitle")
             '移动到下一条记录
             rs.movenext
         end if
         if not rs.eof then
             pic2="upfile/" & rs("photoFilename")
             link2=rs("photoID")
             text2=rs("photoTitle")
             rs.movenext
         end if
         if not rs.eof then
             pic3="upfile/" & rs("photoFilename")
             link3=rs("photoID")
             text3=rs("photoTitle") 
             rs.movenext
         end if
         if not rs.eof then
             pic4="upfile/" & rs("photoFilename")
             link4=rs("photoID")
             text4=rs("photoTitle")
             rs.movenext
         end if
         if not rs.eof then
             pic5="upfile/" & rs("photoFilename")
             link5=rs("photoID")
             text5=rs("photoTitle")
         end if
         '关闭记录集
         rs.close
         set rs=nothing
         conn.close
         set conn=nothing
%>
<body>
<a target=_self href="javascript:goUrl()"> <span class="f14b"> 
<script type="text/javascript">
imgUrl1="<%=pic1%>";
imgtext1="<%=text1%>"
imgLink1=escape("<%=url1%>");
imgUrl2="<%=pic2%>";
imgtext2="<%=text2%>"
imgLink2=escape("<%=url2%>");
imgUrl3="<%=pic3%>";
imgtext3="<%=text3%>"
imgLink3=escape("<%=url3%>");
imgUrl4="<%=pic4%>";
imgtext4="<%=text4%>"
imgLink4=escape("<%=url4%>");
imgUrl5="<%=pic5%>";
imgtext5="<%=text5%>"
imgLink5=escape("<%=url5%>");


// 自定义Flash的宽度、高度,以及文字高度
 var focus_width=290
 var focus_height=148
 var text_height=18
 var swf_height = focus_height+text_height
 
 var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
 var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
 var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
 
 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
 document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
 document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
 document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
 document.write('<embed src="pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');  document.write('</object>');
 </script>
</span></a><span id=focustext class=f14b> </span> 
</body>
</html>


hayfeng
身份:user
发帖:80
登陆次数:72
17F 发表于 2007/4/28 19:36:59
可以了,谢谢老大阿。
最后提多两个问题:
1.要实现鼠标点击某张图片的代号就打开该图片怎么实现?
2.在幻灯片上显示的图片如果要弄成像原来一样自动显示该图片的缩略图怎么实现?而不是直接显示原始的大图片!

嘎嘎,是我
身份:admin
发帖:1435
登陆次数:3222
18F 发表于 2007/4/29 9:26:05
1。原来的脚本不可以吗?

2。把upfile/改成upfile/small/small_就行了。

hayfeng
身份:user
发帖:80
登陆次数:72
19F 发表于 2007/4/29 12:48:53
所有问题已经解决。
谢谢!

 
标题:
消息图标:                                             
                                            
正文:



* UBB 代码开启

 
CopyRight © 心缘地方 2005-2999. All Rights Reserved