Progress bar for slide jcarousel

Asked

Viewed 246 times

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 I showed above works very well the slide Carousel. Just like the progress bar function. But how do my progress bar function click on the object "bntNext: '.next'" Every time she Zera.???? Where in the progress bar commands, I must put a code, or some variable...

1 answer

1


If you want to trigger the "click" event from the Next button of the Dashboard, then you can use the .trigger() jQuery.

Thus, your code in the second "if" of the Starbar function would look like this:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.