What I want to do is that when my question has a timer and the user next, that question disappears and I can not answer it anymore.
Code:
var timer = $(".active").attr('data-timer');
if (timer == undefined) {
var $carousel = $('#carousel');
var NextElement = $carousel.next('.item').first();
NextElement.addClass('active');
$('.timer').remove();
} else {
var $carousel = $('#carousel');
var ActiveElement = $carousel.find('.item.active');
ActiveElement.remove();
var NextElement = $carousel.next('.item');
NextElement.addClass('active');
$('.timer').remove();
}
It does everything, except that when it enters the else instead of adding me the active in my carousel it adds the class next left.
Instead of that class being added, it should be active, so when it re-enters the if the slide does not work anymore.
Even add the following:
var NextElement = $carousel.next('.item');
But it still does not work