Progress bar for slide jcarousel

6
// Carousel
$(function(){
  $(".peq-carousel").jCarouselLite({
    bntNext: '.next',
    bntPrev: '.prev',
    visible: 7,
    auto: 3000,
    speed: 800,
    vertical: true
  });
});

// Barra Progresso
function startbar(){
  var barr = document.getElementById('timeBar');
  var maxx = barr.max;
  var vall = barr.value;

  if ( vall < maxx ){
    barr.value++;
    setTimeout("startbar()", 7);
  }

  if ( vall >= maxx ){
    barr.value=0;
    startbar();
  }
}

The function that I showed above, works very well the slide carousel. Just like the function of the progress bar. But how do I make my progress bar function click on the object "bntNext: '.next'" Every time she turns .. ???? Where in the progress bar commands, should I put a code, or some variable ...

    
asked by anonymous 22.02.2015 / 00:30

1 answer

1

If you want to trigger the "click" event of the carousel's Next button then you can use jQuery .trigger() .

So your code in the second "if" of the starbar function looks like this:

if ( vall >= maxx ){
    barr.value=0;
    $('.next').trigger('click');
    startbar();
}
    
07.05.2015 / 17:42