I am trying to carry a class between li\'s with combine each() and eq() methods when buttons clicked. I am using same code with previo
You could try even this:
$('.prev').click(function() {
var el = $.find('li[class=active]');
//check if are prev li
if(!$(el).prev().is(':first')) $(el).removeClass('active').prev().addClass('active');
});
$('.next').click(function() {
var el = $.find('li[class=active]');
//check if are next li
if(!$(el).next().is(':last')) $(el).removeClass('active').next().addClass('active');
});