...

View Full Version : Slide Show Tutorial Help



Statto
07-09-2002, 02:32 PM
brilliant script below but I can't get it to work for 4 images. Any helpers ?

<html>
<head>
<script language="JavaScript1.1">
<!--
//preload images
var image1=new Image()
image1.src="firstimage.gif"
var image2=new Image()
image2.src="secondimage"
var image3=new Image()
image3.src="thirdimage.gif"
//-->
</script>
</head>
<body onLoad="slideit()">
<a href="javascript:slidelink()"><img src="firstimage.gif" name="slide" border=0 style="filter:blendTrans(duration=3)"></a>
<script>
<!--
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
//If the browser is IE 4.x
if (document.all)
slide.filters.blendTrans.apply()
document.images.slide.src=eval("image"+step+".src")
//If the browser is IE 4.x
if (document.all)
slide.filters.blendTrans.play()
whichimage=step
if (step<3)
step++
else
step=1
setTimeout("slideit()",5000)
}
function slidelink(){
if (whichimage==1)
window.location="link1.htm"
else if (whichimage==2)
window.location="link2.htm"
else if (whichimage==3)
window.location="link3.htm"
}
//-->
</script>
</body>
</html>

MikoLone
07-09-2002, 04:17 PM
<html>
<head>
<script language="JavaScript1.1">
<!--
//preload images
var image1=new Image() ;
image1.src="firstimage.gif"
var image2=new Image() ;
image2.src="secondimage" ;
var image3=new Image() ;
image3.src="thirdimage.gif" ;
var image4=new Image();
image4.src="fourthimage.gif";
//-->
</script>
</head>
<body onLoad="slideit()">
<a href="javascript:slidelink()"><img src="firstimage.gif" name="slide" border=0 style="filter:blendTrans(duration=4)"></a>
<script>
<!--
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
//If the browser is IE 4.x
if (document.all)
slide.filters.blendTrans.apply()
document.images.slide.src=eval("image"+step+".src")
//If the browser is IE 4.x
if (document.all)
slide.filters.blendTrans.play()
whichimage=step
if (step<4)
step++
else
step=1
setTimeout("slideit()",5000)
}
function slidelink(){
if (whichimage==1)
window.location="link1.htm" ;
else if (whichimage==2)
window.location="link2.htm" ;
else if (whichimage==3)
window.location="link3.htm" ;
else if (whichimage==4)
window.location="link4.htm";
}
//-->
</script>
</body>
</html>


I think this should work. I didn't test it however. Good luck



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum