Blueprint-FixedBackgroundScrollingLayout
Blueprint-FixedBackgroundScrollingLayout copied to clipboard
Add Autoplay
Feature Request: Option for autoplay the slider at a set interval, like 5 seconds.
$(window).load(function(){
cpb_currentSlider = $('.cbp-fbcurrent').attr('href');
var cpb_lastChar = cpb_currentSlider.substr(cpb_currentSlider.length - 1);
function cpb_getCurrentSlider() {
cpb_currentSlider = $('.cbp-fbcurrent').attr('href');
}
function cpb_getLastChar() {
cpb_lastChar = cpb_currentSlider.substr(cpb_currentSlider.length - 1);
}
setInterval(function() {
cpb_getCurrentSlider();
cpb_getLastChar();
cpb_nextChar = cpb_lastChar++;
cpb_nextSlider = "#fbsection" + cpb_lastChar;
if (cpb_nextSlider == '#fbsection6') {
cpb_nextSlider = '#fbsection1';
}
$('a[href$='+cpb_nextSlider+']').trigger("click");
}, 5000);
});