Есть вот такой вот код
/* Elite */
var _elite_timeouts = [];
var _elite_delay = 6000;
$('.elite-menu-item').on('click', function(e){
$('.elite-menu-item_active').removeClass('elite-menu-item_active');
$('.elite-images__item').removeClass('slides-images__item_active');
$('.elite-item').removeClass('slides__item_active');
$(this).addClass('elite-menu-item_active');
$('.elite-images__item').eq($(this).index()).addClass('slides-images__item_active');
$('.elite-item').eq($(this).index()).addClass('slides__item_active');
for (var i = 0; i < _elite_timeouts.length; i++)
{
clearTimeout(_elite_timeouts[i]);
}
_elite_timeouts = [];
_elite_timeouts.push(setTimeout(function(){
rotateElite();
}, _elite_delay));
});
$('.elite-menu-item').on('click', function(e){
var next_item = ($('.elite-menu-item_active').next().length > 0 ? $('.elite-menu-item_active').next() : $('.elite-menu-item:first'));
if ($(this).hasClass('slides-controls__item_left'))
{
next_item = ($('.elite-menu-item_active').prev().length > 0 ? $('.elite-menu-item_active').prev() : $('.elite-menu-item:last'));
}
$(next_item).click();
});
function rotateElite()
{
var next_item = ($('elite-menu-item_active').next().length > 0 ? $('elite-menu-item_active').next() : $('elite-menu-item:first'));
$(next_item).click();
_elite_timeouts.push(setTimeout(function(){
rotateElite();
}, _elite_delay));
}
_elite_timeouts.push(setTimeout(function(){
rotateElite();
}, _elite_delay));
/* \Elite */
Но почему то не слайдит автоматически..Где то указаны неверные параметры?
Вот для примера код аналогичный,который работает
/* Oasis */
var _oasis_timeouts = [];
var _oasis_delay = 6000;
$('#oasis .oasis-gallery-buttons__item').on('click', function(e){
$('.oasis-gallery-buttons__item_active').removeClass('oasis-gallery-buttons__item_active');
$('.oasis-gallery .slides-images__item_active').removeClass('slides-images__item_active');
$(this).addClass('oasis-gallery-buttons__item_active');
$('.oasis-gallery .slides-images__item').eq($(this).index()).addClass('slides-images__item_active');
for (var i = 0; i < _oasis_timeouts.length; i++)
{
clearTimeout(_oasis_timeouts[i]);
}
_oasis_timeouts = [];
_oasis_timeouts.push(setTimeout(function(){
rotateOasis();
}, _oasis_delay));
});
$('#oasis .slides-controls__item').on('click', function(e){
var next_item = ($('#oasis .oasis-gallery-buttons__item_active').next().length > 0 ? $('#oasis .oasis-gallery-buttons__item_active').next() : $('#oasis .oasis-gallery-buttons__item:first'));
if ($(this).hasClass('slides-controls__item_left'))
{
next_item = ($('#oasis .oasis-gallery-buttons__item_active').prev().length > 0 ? $('#oasis .oasis-gallery-buttons__item_active').prev() : $('#oasis .oasis-gallery-buttons__item:last'));
}
$(next_item).click();
});
function rotateOasis()
{
var next_item = ($('#oasis .oasis-gallery-buttons__item_active').next().length > 0 ? $('#oasis .oasis-gallery-buttons__item_active').next() : $('#oasis .oasis-gallery-buttons__item:first'));
$(next_item).click();
_oasis_timeouts.push(setTimeout(function(){
rotateOasis();
}, _oasis_delay));
}
_oasis_timeouts.push(setTimeout(function(){
rotateOasis();
}, _oasis_delay));