document.addEventListener('DOMContentLoaded', function() { var carousel = document.querySelector('.et_pb_slider'); if (carousel) { var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.type === 'childList') { startAutoplay(); } }); }); observer.observe(carousel, { childList: true, subtree: true }); function startAutoplay() { var interval = setInterval(function() { var nextButton = document.querySelector('.et-pb-slider-arrows .et-pb-arrow-next'); if (nextButton) { nextButton.click(); } }, 2000); var arrowButtons = document.querySelectorAll('.et-pb-slider-arrows a'); arrowButtons.forEach(function(button) { button.addEventListener('click', function() { clearInterval(interval); setTimeout(startAutoplay, 2000); }); }); } startAutoplay(); } });