欢迎来到福编程网,本站提供各种互联网专业知识!

DHTML Slide Show script图片轮换

发布时间:2008-03-03 作者: 来源:转载
步骤1:将下面代码加到标签内:复制代码代码如下:/************************************************DHTMLslideshowscript-©DynamicDriveDHTMLcodelibrary(www.dynamicdrive.com)*Thisnoticemuststayintactforlegaluse*Visithttp://www.dynamicdrive.com/
步骤1:将下面代码加到标签内:
复制代码 代码如下:


/***********************************************
*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;ipreloadedimages[i]=newImage()
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(whichwhich++
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}
functiontransport(){
window.location=photoslink[which]
}


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








PreviousSlide
NextSlide


FreeDHTMLscriptsprovidedby


DynamicDrive


相关推荐