Wednesday 14 August 2013

Jquery Slider with sliding interval

Jquery Slider with sliding interval

Ok so , i'm trying to build a custom slideshow using bxslider jquery's
plugin , but i would like to put a custom pause interval for each slide .
let's say i have a slideshow with 3 slides i want it to be like :
30 seconds 8 sec 8 sec
|-------------------|------|-------|
slide 1 slide2 slide3
I did try to solve this using setInterval using bxslider's public
functions , but unfortunately it's not scalable to many slides:
var slid=$('#slider1').bxSlider({
auto: false,
speed:1000,
infiniteLoop: false,
mode: 'horizontal',
controls: false,
pager: false,
});
function bringback() {
slid.goToSlide(0);
}
function bringback2() {
slid.goToSlide(2);
setTimeout( bringback, 8000 );
}
$(document).ready(function(){
setInterval(function(){
slid.goToSlide(1);
setTimeout( bringback2, 8000 );
}, 30000);
});
i'm looking for a solution that takes an array with intervals [30 , 8 , 8]
and tries to apply it for the slideshow.

No comments:

Post a Comment