Locals Find!
New Member
Here are few easy to use slideshow Java Scripts. For many on this board this is going to be old news or something they already have. Please don't comment negatively.
For those of you who don't have one on your site. This can be useful. I have highlighted the parts of the script you will need to edit in RED the bold sections are just titles & spacers and don't belong to the code.
There are two scripts here. One for a simple slideshow & one for a clickable slideshow.
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
Slideshow
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
<------------------------------------------------------------------------------->
<html>
<head>
<script type="text/javascript">
<!--
var image1=new Image()
image1.src="firstcar.gif"
var image2=new Image()
image2.src="secondcar.gif"
var image3=new Image()
image3.src="thirdcar.gif"
var image4=new Image()
image4.src="adtechia-New-Logo copy.gif"
//-->
</script>
</head>
<body>
<img src="/images/firstcar.gif" name="slide" width="300" height="256" />
<script>
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<3)
step++
else
step=1
//call function "slideit()" every 15.0 seconds
setTimeout("slideit()",15000)
}
slideit()
//-->
</script>
</body>
</html>
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
Clickable Slide show
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
<------------------------------------------------------------------------------->
<html>
<head>
<script type="text/javascript">
<!--
//preload images
var image1=new Image()
image1.src="firstcar.gif"
var image2=new Image()
image2.src="secondcar"
var image3=new Image()
image3.src="thirdcar.gif"
//-->
</script>
</head>
<body>
<a href="javascript:slidelink()">
<img src="firstcar.gif" name="slide" border="0" width="100" height="56" /></a>
<script type="text/javascript">
<!--
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
whichimage=step
if (step<3)
step++
else
step=1
setTimeout("slideit()",1800)
}
slideit()
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>
---------------------------------------------------------------------------------------
For those of you who don't have one on your site. This can be useful. I have highlighted the parts of the script you will need to edit in RED the bold sections are just titles & spacers and don't belong to the code.
There are two scripts here. One for a simple slideshow & one for a clickable slideshow.
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
Slideshow
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
<------------------------------------------------------------------------------->
<html>
<head>
<script type="text/javascript">
<!--
var image1=new Image()
image1.src="firstcar.gif"
var image2=new Image()
image2.src="secondcar.gif"
var image3=new Image()
image3.src="thirdcar.gif"
var image4=new Image()
image4.src="adtechia-New-Logo copy.gif"
//-->
</script>
</head>
<body>
<img src="/images/firstcar.gif" name="slide" width="300" height="256" />
<script>
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<3)
step++
else
step=1
//call function "slideit()" every 15.0 seconds
setTimeout("slideit()",15000)
}
slideit()
//-->
</script>
</body>
</html>
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
Clickable Slide show
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
<------------------------------------------------------------------------------->
<html>
<head>
<script type="text/javascript">
<!--
//preload images
var image1=new Image()
image1.src="firstcar.gif"
var image2=new Image()
image2.src="secondcar"
var image3=new Image()
image3.src="thirdcar.gif"
//-->
</script>
</head>
<body>
<a href="javascript:slidelink()">
<img src="firstcar.gif" name="slide" border="0" width="100" height="56" /></a>
<script type="text/javascript">
<!--
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
whichimage=step
if (step<3)
step++
else
step=1
setTimeout("slideit()",1800)
}
slideit()
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>
---------------------------------------------------------------------------------------
Last edited by a moderator: