首頁 > web前端 > js教程 > 主體

DHTML Slide Show script图片轮换_图象特效

WBOY
發布: 2016-05-16 19:05:58
原創
890 人瀏覽過

步骤 1: 将下面代码加到 

 标签内:
复制代码 代码如下:


<script> <BR>/*********************************************** <BR>* DHTML slideshow script- &copy; Dynamic Drive DHTML code library (www.dynamicdrive.com) <BR>* This notice must stay intact for legal use <BR>* Visit http://www.dynamicdrive.com/ for full source code <BR>***********************************************/ <BR>var photos=new Array() <BR>var photoslink=new Array() <BR>var which=0 <BR>//define images. You can have as many as you want: <BR>photos[0]="photo1.jpg" <BR>photos[1]="photo2.jpg" <BR>photos[2]="photo3.jpg" <BR>//Specify whether images should be linked or not (1=linked) <BR>var linkornot=0 <BR>//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1" <BR>photoslink[0]="" <BR>photoslink[1]="" <BR>photoslink[2]="" <BR>//do NOT edit pass this line <BR>var preloadedimages=new Array() <BR>for (i=0;i<photos.length;i++){ <BR>preloadedimages[i]=new Image() <BR>preloadedimages[i].src=photos[i] <BR>} <BR>function applyeffect(){ <BR>if (document.all && photoslider.filters){ <BR>photoslider.filters.revealTrans.Transition=Math.floor(Math.random()*23) <BR>photoslider.filters.revealTrans.stop() <BR>photoslider.filters.revealTrans.apply() <BR>} <BR>} <BR>function playeffect(){ <BR>if (document.all && photoslider.filters) <BR>photoslider.filters.revealTrans.play() <BR>} <BR>function keeptrack(){ <BR>window.status="Image "+(which+1)+" of "+photos.length <BR>} <BR>function backward(){ <BR>if (which>0){ <BR>which-- <BR>applyeffect() <BR>document.images.photoslider.src=photos[which] <BR>playeffect() <BR>keeptrack() <BR>} <BR>} <BR>function forward(){ <BR>if (which<photos.length-1){ <BR>which++ <BR>applyeffect() <BR>document.images.photoslider.src=photos[which] <BR>playeffect() <BR>keeptrack() <BR>} <BR>} <BR>function transport(){ <BR>window.location=photoslink[which] <BR>} <BR></script>  

步骤 2: 将下面代码加到需要的地方:
复制代码 代码如下:


  
  
  
  
  
  
  
  
  
<script> <BR>if (linkornot==1) <BR>document.write('<a href="javascript:transport()">') <BR>document.write('<img src="'+photos[0]+'" name="photoslider" style="max-width:90%" border=0 alt="DHTML Slide Show script图片轮换_图象特效" >') <BR>if (linkornot==1) <BR>document.write('') <BR></script>  

Previous Slide

Next Slide

  

Free DHTML scripts provided by
  
Dynamic Drive

 
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板