How to make a rotating banner in JS with array

0

I'm starting in JS and would like to do rotating banner by placing the images inside a vector instead of doing as in the code below:

function slide1(){
   document.getElementById("banner").src = "img/banner9.png";
   setTimeout(slide2,1000);
}

function slide2(){
   document.getElementById("banner").src = "img/banner8.png";
   setTimeout(slide1,1000);
}

It would be unfair of me to ask you to give me the code, so do you have any guidance where I can search?

    
asked by anonymous 04.12.2016 / 21:26

1 answer

0

The name is carousel. I recommend using Slick or the Owl Carousel . They are very light and simple to implement. No need to reinvent the wheel.

    
04.12.2016 / 23:58