// Remove the active class from existing slide $slides.removeClass('et-pb-active-slide'); // Restore visibility to the slides $slides.css('visibility', 'visible'); // Add the active class to the first slide $slides.first().addClass('et-pb-active-slide'); }); });