Creating Custom image Slider in pure Javascript

Posted by Mayank K.
6
Dec 22, 2018
427 Views

This one is my first post on this blog and I’ll be contributing here quite often from now on. Since this is my first content so I would like to keep it simple. This is a tutorial to create a very basic image slider using JavaScript and HTML. Just copy paste the following code and it will work right away. This code is working perfectly in chrome, Firefox and IE.

Below is the complete code for the image slider-

Instructions:

The location of the images needs to be mentioned in the array

You can add some CSS to it in order to make it look exactly the way you want. That’s all up to you and if you want to change the speed of the transition, just change the number from this line setTimeout("slideimage()",3000);

That’s it for my first content on this blog. Hope you found it useful. Let me know if you find any problem with it.

Comments
avatar
Please sign in to add comment.