Heim > Web-Frontend > js-Tutorial > Hauptteil

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

WBOY
Freigeben: 2016-05-16 19:05:58
Original
890 Leute haben es durchsucht

步骤 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

 
Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage