New to Javascript, but after some research it loks like this would be the best method in implementing my desired output. I'm trying to produce a slideshow of images (5 pre-selected images) that automatically change between 5 second intervals. Can anyone point towards a tutorial or guide me along in this process? Any help is very much appreciated.
Here is a Very simple code to create simple JavaScript/HTML slideshow only by using simple JavaScript and HTML codes :
<script language="JavaScript">
var i = 0; var path = new Array();
// LIST OF IMAGES
path[0] = "image_1.gif";
path[1] = "image_2.gif";
path[2] = "image_3.gif";
function swapImage()
{
document.slide.src = path[i];
if(i < path.length - 1) i++;
else i = 0;
setTimeout("swapImage()",3000);
}
window.onload=swapImage;
</script>
<img height="200" name="slide" src="image_1.gif" width="400" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With