复制代码 代码如下:
/***********************************************
*DHTMLslideshowscript-©DynamicDriveDHTMLcodelibrary(www.dynamicdrive.com)
*Thisnoticemuststayintactforlegaluse
*Visithttp://www.dynamicdrive.com/forfullsourcecode
***********************************************/
varphotos=newArray()
varphotoslink=newArray()
varwhich=0
//defineimages.Youcanhaveasmanyasyouwant:
photos[0]="photo1.jpg"
photos[1]="photo2.jpg"
photos[2]="photo3.jpg"
//Specifywhetherimagesshouldbelinkedornot(1=linked)
varlinkornot=0
//SetcorrespondingURLsforaboveimages.DefineONLYifvariablelinkornotequals"1"
photoslink[0]=""
photoslink[1]=""
photoslink[2]=""
//doNOTeditpassthisline
varpreloadedimages=newArray()
for(i=0;i
preloadedimages[i].src=photos[i]
}
functionapplyeffect(){
if(document.all&&photoslider.filters){
photoslider.filters.revealTrans.Transition=Math.floor(Math.random()*23)
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}
functionplayeffect(){
if(document.all&&photoslider.filters)
photoslider.filters.revealTrans.play()
}
functionkeeptrack(){
window.status="Image"+(which+1)+"of"+photos.length
}
functionbackward(){
if(which>0){
which--
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}
functionforward(){
if(which
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}
functiontransport(){
window.location=photoslink[which]
}
步骤2:将下面代码加到需要的地方:
复制代码 代码如下: