[Solved] Repit function and auto increment


I’m sorry, I’m having trouble understanding your question. Do you just want to constantly rotate through the images you provide? Check out the fiddle below.

http://jsfiddle.net/denniswaltermartinez/f8mVj/

function slider(id) {
    id = id || 0;

    var n_image = $('[class^="img_"]').length;

    if (n_image < id) id -= n_image;

    setTimeout(function () {
        $('img:not(.img_'+ id +')').fadeOut('slow');
        $('.img_' + id).fadeIn('slow', function () {
            id++;
            slider(id);
        });
    }, 1000);
}
slider(1);

Hopefully this will push you into the right direction.

0

solved Repit function and auto increment