您现在的位置:首页 >> JS&Jq >> 内容

纯javascript实现的幻灯片实例

时间:2013-6-17 15:31:56 点击:

  核心提示:这里介绍一个纯javascript幻灯片实例a href= '#'onclick= 'jump2url(this); ' img border='0'width='334' height='1...
这里介绍一个纯javascript幻灯片实例
<a href= "#"  onclick= "jump2url(this); "> 
<img border="0"  width="334" height="186"  style= "FILTER: revealTrans(duration=2,transition=20)" src= "javascript:nextAd()" name= "imgInit" /> </a> 
<div style= "padding:3px;line-height:150% "> <a href="" onmouseover= "this.title=this.innerHTML" id= "Hter"> </a> </div> 

<script type="text/javascript"> 
var I = new Array(); 
var H = new Array(); 
var T = new Array(); 
var preloadedimages = new Array(); 
var adNum = 0; 


for (i=0;i < I.length;i++){ 
  preloadedimages[i]=new Image(); 
  preloadedimages[i].src=I[i]; 
} 

function setTransition(){ 
  if (document.all){ 
    imgInit.filters.revealTrans.Transition=Math.floor(Math.random()*23); 
    imgInit.filters.revealTrans.apply(); 
  } 
} 

function playTransition(){ 
  if (document.all) 
    imgInit.filters.revealTrans.play(); 
} 

function nextAd(){ 
  if(adNum < I.length-1) 
  adNum++ ; 
  else 
  adNum = 0; 
  setTransition(); 
  document.images.imgInit.src=I[adNum]; 
  document.images.imgInit.alt=T[adNum]; 
  document.images.imgInit.title=T[adNum]; 
  document.all.Hter.innerHTML=T[adNum]; 
  document.all.Hter.href=H[adNum]; 
  playTransition(); 
  theTimer = window.setTimeout( "nextAd() ",5000); 
} 

function jump2url(o){ 
  jumpUrl = H[adNum]; 
  jumpTarget = '_blank '; 
  if(jumpUrl != ' ') 
  { 
  o.target=jumpTarget; 
  o.href=jumpUrl;  
  } 
} 

I[0] = "http://www.aspbc.com/uploadfile/adv/s201251185558.jpg"; 
H[0] = "http://www.aspbc.com/code/showcode.asp?id=185";
T[0] = "绿色食品网站PSD模版"; 

I[1] = "http://www.aspbc.com/uploadfile/adv/s2012425164416.jpg"; 
H[1] = "http://www.aspbc.com/soft/showsoft.asp?id=181"; 
T[1] = "asp开发工具4.0"; 

I[2] = "http://www.aspbc.com/uploadfile/adv/s20111019140650.jpg"; 
H[2] = "http://www.aspbc.com/tech/showtech.asp?id=546"; 
T[2] = "VS2010三层架构实例显示某张表中"; 

nextAd() 
</script> 

作者:佚名 来源:不详
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 青春网络编程技术(www.qcfupo.com) © 2021 版权所有 All Rights Reserved.
  • Powered by qcfupo! V3.0sp1
  • 百度友情链接: 百家乐[www.chinawestnews.net/aomenbaijiale/] 赌博网[www.chinawestnews.net/amdbwz/] 海立方[www.bjl.gov.cn/bjgylc/] 娱乐城[www.gtxrmzf.gov.cn/mapai/] 娱乐城[www.hfsf.gov.cn/yfgj/] 威尼斯人[www.hllinkou.gov.cn/baijile/] 澳门威尼斯[www.jjwgj.gov.cn/wnsr/] 888真人[www.lagm.gov.cn/888zhenren/] 百乐坊[www.laoling.gov.cn/blfylc/] 现金网[www.longyu.gov.cn/xjw/] 百家乐[www.chinawestnews.net/ambjl/] 新葡京娱乐场[www.sjzedu.gov.cn/jsylc/] 时时彩[www.snjw.gov.cn/ssc/] 赌博[www.chinawestnews.net/aomendubo/]