2011-08-01

Como agregar un contador a nuestra galería de fotos, con el plugin jQuery Cycle.


$(function(){

    $('#mini-photos').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        next:   '#arrow-ad-l',
        prev:   '#arrow-ad-r',
        after:     onAfter
    });  
});

function onAfter(curr,next,opts) {
    var caption = (opts.currSlide + 1) + ' / ' + opts.slideCount;
        $('#num').text(caption)
}



Demo online: Link

No hay comentarios: