嘿伙计们,我在寻找一种简单的方法来添加转换到一个非常基本的javascript图像幻灯片时遇到了一些麻烦:
//variable that will increment through the images
var step=1
var whichimage=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval('image'+step+'.src')
whichimage=step
if (step<3)
step++
else
step=1
//call function 'slideit()' every 5 seconds
setTimeout('slideit()',5000)
}
slideit()
function slidelink(){
if (whichimage==1)
window.location='page1.php'
else if (whichimage==2)
window.location='page1.php'
else if (whichimage==3)
window.location='index.php'
}
如何添加淡入或滑动过渡?