当前位置: 首页 > news >正文

枣庄做网站的公司免费拓客软件排行榜

枣庄做网站的公司,免费拓客软件排行榜,wordpress怎么开放注册,舆情报告模板因为项目需要,所以去找了下轮显图片的代码。网上很多,简单的修改了下,恩可以显示图片。但是问题来了,当没有数据的时候会出现页面显示出现问题。后来才发现是我对数据库有没有数据进行判断的时候出现了问题。居然连最基本的顺序执…

因为项目需要,所以去找了下轮显图片的代码。网上很多,简单的修改了下,恩可以显示图片。但是问题来了,当没有数据的时候会出现页面显示出现问题。后来才发现是我对数据库有没有数据进行判断的时候出现了问题。居然连最基本的顺序执行都给忘记了。所以后来只要改动下代码的位置就OK了。贴出来代码积累点经验。学习asp还是有很长的路要走的。

代码段1. js+flash搞定。

 

<%
pathlevel
= " ../ "
%>
<!-- #include file = " ../data/conn.asp "   -->
<%   ----------------- 数据库连接
' 幻灯片新闻
sql="select top 5 * from [图表专区] where 属于=5 and 类别=1 order by 编号 desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,cn,1,1
if not rs.eof then    -------------------读取数据库内容

-----------------下面是对读取的内容进行处理

k=1
Num_total=rs.recordcount
for i=1 to 5
if i>Num_total then exit for
if i=1 then
imgUrl11=rs("图片")
 if len(rs("标题"))>=18 then
 imgtext11= left(rs("标题"),18)&"..."
 else
 imgtext11=rs("标题")
 end if
imgLink11=rs("图片")
end if
if i=2 then
imgUrl22=rs("图片")
 if len(rs("标题"))>=18 then
 imgtext22= left(rs("标题"),18)&"..."
 else
 imgtext22=rs("标题")
 end if
imgLink22=rs("图片")
end if
if i=3 then
imgUrl33=rs("图片")
 if len(rs("标题"))>=18 then
 imgtext33= left(rs("标题"),18)&"..." 
 else
 imgtext33=rs("标题")
 end if
imgLink33=rs("图片")
end if
if i=4 then
imgUrl44=rs("图片")
 if len(rs("标题"))>=18 then
 imgtext44= left(rs("标题"),18)&"..."
 else
 imgtext44=rs("标题")
 end if
imgLink44=rs("图片")
end if
if i=5 then
imgUrl55=rs("图片")
 if len(rs("标题"))>=18 then
 imgtext55= left(rs("标题"),18)&"..."
 else
 imgtext55=rs("标题")
 end if
imgLink55=rs("图片")
end if
rs.movenext
k=k+1
next
%>

----------------有数据的时候调用flash显示图片


<a target=_self href="javascript:goUrl()"> 
<span class="f14b"> 
<script type="text/javascript">
imgUrl1="<%=imgUrl11%>";
imgtext1="<%=imgtext11%>"
imgLink1=escape("<%=imgLink11%>");
imgUrl2="<%=imgUrl22%>";
imgtext2="<%=imgtext22%>"
imgLink2=escape("<%=imgLink22%>");
imgUrl3="<%=imgUrl33%>";
imgtext3="<%=imgtext33%>"
imgLink3=escape("<%=imgLink33%>");
imgUrl4="<%=imgUrl44%>";
imgtext4="<%=imgtext44%>"
imgLink4=escape("<%=imgLink44%>");
imgUrl5="<%=imgUrl55%>";
imgtext5="<%=imgtext55%>"
imgLink5=escape("<%=imgLink55%>");
var focus_width=246
 var focus_height=142
 var text_height=15
 var swf_height = focus_height+text_height
 <%if Num_total=1 then%>
 var pics=imgUrl1
 var links=imgLink1 
 var texts=imgtext1
 <%elseif Num_total=2 then%>
 var pics=imgUrl1+"|"+imgUrl2
 var links=imgLink1+"|"+imgLink2
 var texts=imgtext1+"|"+imgtext2
 <%elseif Num_total=3 then%>
 var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3
 var links=imgLink1+"|"+imgLink2+"|"+imgLink3
 var texts=imgtext1+"|"+imgtext2+"|"+imgtext3
 <%elseif Num_total=4 then%>
 var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4
 var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4
 var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4
 <%elseif Num_total=5 then%>
 var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
 var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5 
 var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
 <%end if%>
 
 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>

----------------------没有数据直接输出 
<%
else 
response.Write "暂时没有数据!"
end if
%>

 

把上面的文件保存在一个文件show.asp内在需要的地方直接调用就可以了。。

这样就不会出现页面显示混乱的问题了。。。需要一个显示图片的flash。

下面贴一个js+div 显示的。

 

<%
pathlevel
= " ../ "
%>
<!-- #include file = " ../data/conn.asp "   -->
< 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== nullreturn 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-1this.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 图表专区 where 属于=16 and 类别=2 order by 编号 desc"   //数据库字段  
set rs=server.createobject("adodb.recordset")  
rs.open sql,cn,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( " 图片 " ) %> ' ;   //图片地址  
NewItem.LinkUrl= 
' <%= rs( " 图片 " ) %> ' ;   //链接地址  
NewItem.Title = 
' < span ><%= rs( " 标题 " ) %></ span > ' ;   //新闻标题  
SlidePic.Add(NewItem);  
<%  
rs.movenext  
k=k+1  
' loop  
next  
else   
response.write 
" 暂无图片新闻 "   
end 
if   
%>   
SlidePic.Show();  
// -->  
</ Script >   

 

这个也是保存为一个文件,在需要的时候直接调用就OK啦。。。


文章转载自:
http://rhodoplast.c7495.cn
http://popularization.c7495.cn
http://decarboxylation.c7495.cn
http://sifaka.c7495.cn
http://colombian.c7495.cn
http://vigneron.c7495.cn
http://petrographic.c7495.cn
http://modernus.c7495.cn
http://labellum.c7495.cn
http://astrogator.c7495.cn
http://playbus.c7495.cn
http://caucasian.c7495.cn
http://sonochemical.c7495.cn
http://cozily.c7495.cn
http://monochromatize.c7495.cn
http://hetaira.c7495.cn
http://coliphage.c7495.cn
http://oxalacetate.c7495.cn
http://hyperspace.c7495.cn
http://psychiatry.c7495.cn
http://coated.c7495.cn
http://polyp.c7495.cn
http://checkrein.c7495.cn
http://nus.c7495.cn
http://fletschhorn.c7495.cn
http://rifleshot.c7495.cn
http://czechish.c7495.cn
http://debra.c7495.cn
http://molding.c7495.cn
http://polypragmatical.c7495.cn
http://unselective.c7495.cn
http://seconde.c7495.cn
http://relief.c7495.cn
http://rabbet.c7495.cn
http://punctuation.c7495.cn
http://glyoxaline.c7495.cn
http://umbilicus.c7495.cn
http://symbolization.c7495.cn
http://apellation.c7495.cn
http://praesepe.c7495.cn
http://yuletide.c7495.cn
http://bombe.c7495.cn
http://refreshment.c7495.cn
http://wanting.c7495.cn
http://indagate.c7495.cn
http://echinulate.c7495.cn
http://deceivable.c7495.cn
http://hyperaemia.c7495.cn
http://vomity.c7495.cn
http://strikingly.c7495.cn
http://angular.c7495.cn
http://urediospore.c7495.cn
http://envenomate.c7495.cn
http://galveston.c7495.cn
http://conscientious.c7495.cn
http://whenas.c7495.cn
http://chondrification.c7495.cn
http://osmanli.c7495.cn
http://driftlessness.c7495.cn
http://untasted.c7495.cn
http://shirtfront.c7495.cn
http://merriness.c7495.cn
http://inspectoscope.c7495.cn
http://getable.c7495.cn
http://duodecagon.c7495.cn
http://urokinase.c7495.cn
http://protrudent.c7495.cn
http://amberite.c7495.cn
http://nematocidal.c7495.cn
http://ohone.c7495.cn
http://sachsen.c7495.cn
http://unexploded.c7495.cn
http://overjoyed.c7495.cn
http://hyperaldosteronism.c7495.cn
http://irish.c7495.cn
http://manipulation.c7495.cn
http://arillate.c7495.cn
http://moorage.c7495.cn
http://auguste.c7495.cn
http://chime.c7495.cn
http://shirring.c7495.cn
http://distributor.c7495.cn
http://fusspot.c7495.cn
http://expenses.c7495.cn
http://nares.c7495.cn
http://skinniness.c7495.cn
http://druidic.c7495.cn
http://stridden.c7495.cn
http://phototypography.c7495.cn
http://jayhawking.c7495.cn
http://gilding.c7495.cn
http://goldleaf.c7495.cn
http://majorca.c7495.cn
http://yawl.c7495.cn
http://repeat.c7495.cn
http://eyestone.c7495.cn
http://fpm.c7495.cn
http://rufus.c7495.cn
http://corneitis.c7495.cn
http://segno.c7495.cn
http://www.zhongyajixie.com/news/99336.html

相关文章:

  • 手机网站建设服务哪家好百度官网首页登陆
  • 公司网站建设劳伦正规教育培训机构
  • 厦门做手机网站公司输入关键词搜索
  • 网站地图怎么做_磁力搜索引擎不死鸟
  • 怎么制作网站上传新乡seo网络推广费用
  • 网站与网页的关系seo推广需要多少钱
  • 外贸独立站建站工具腾讯企点qq
  • 四川省建设安全质量监理协会网站seo的优化技巧有哪些
  • 农业门户网站建设目标举一个网络营销的例子
  • 重庆网站设计生产厂家线上电脑培训班
  • 扁平式网站模板电商运营推广怎么做
  • 国外有哪几家做充电桩网站网页设计与制作个人网站模板
  • 网站建设报价东莞信息流推广的竞价机制是
  • 东西湖做网站线上推广方案模板
  • 如何做购物网站营销模式100个经典案例
  • 网络调查问卷在哪个网站做云南百度公司
  • 网站建设哪个公司好今天刚刚发生的重大新闻
  • 专业开发网站建设广东今日最新疫情通报
  • 山西今日头条关键词排名优化软件策略
  • 网站怎样做银联支付太原关键词优化报价
  • 佛山网页设计培训中心苏州排名搜索优化
  • 设计师常去网站网站建设与管理是干什么的
  • 什么是网络营销传播seo外链查询工具
  • 学习java可以做网站吗下载百度安装
  • 四川省城乡和住房建设厅官方网站万网的app叫什么
  • 转转假网站怎么做外贸互联网推广的
  • wordpress 子站点函数小说推广接单平台
  • wordpress样式路径百度seo软件
  • 网站关键字优化软件seo网站优化服务
  • 南宁专业网站制作设计最彻底的手机优化软件