Image slideshow using JavaScript

Saratvaddilli
Posted by Saratvaddilli under JavaScript category on | Points: 40 | Views : 1560
<script language="JavaScript" type="text/javascript">
var count = 0
var images = new Array('morning.jpg','afternoon.jpg','night.jpg','lightbulb_on.jpg')

function slideShow(direction){

if (direction == 'next' && count <=2){
count++
}

if (direction == 'back' && count >=1){
count --;
}

document.getElementById("show").innerHTML = (count+1)+" of 4 <br> <img src='images/"+images[count]+"'>"
}
</script>

Comments or Responses

Login to post response