Adding forward and rewind buttons

1

I made a java script that changes the background-image of my <header> into the site, but I would like to know if it's in it to add the next (>) and previous (<) cursor to change the images when clicking in them already it is changing autómaticamante more I would like to implement this option.

JS:

var images=new Array('img/bg-header.jpg','img/bg-header-2.jpg');
var nextimage=0;
doSlideshow();

function doSlideshow(){
    if(nextimage>=images.length){nextimage=0;}
    $('.header')
        .css('background-image','url("'+images[nextimage++]+'")')
        .fadeIn(100,function(){
            setTimeout(doSlideshow,4000);
        });
}
    
asked by anonymous 15.02.2017 / 18:05

0 answers