13 Develop a JavaScript to create a Slide Show.( At least 3 Slide)

Program:
<html>



<head>

    <script>

        var img_array = new Array('./submit.jpg','./reset.jpg','./Logo.png');

        var img = 0;

        function Display(num) {

            img = img + num;

            if (img > img_array.length - 1) {

                img = 0;

            }

            if (img < 0) {

                img = img_array.length - 1;

            }

            document.Slide.src = img_array[img];

        }

    </script>

</head>

<body>

    <img src="submit.jpg" width="400" height="220"

        name="Slide" />

    <br /><br />

    <input type="button" value="Previous" onclick="Display(-1)">

    <input type="button" value="Next" onclick="Display(1)">

</body>



</html>


Output:
JavaScript to create a Slide Show

Previous
Next Post »