On debut mode code is working properly but on Proper run code run once and stop const leftArrow = document.querySelector('.arrow-left'); const rightArrow = document.querySelector('.arrow-right'); const tabsWrapper = document.querySelector('.tabs-wrapper'); const tabs = document.querySelector('.tabs'); for (var i = 0; i < tabs.childElementCount; i++) { if (tabs.children.className != "Active") { tabsWrapper.scrollBy({ left: 200, // Scroll right by 200px behavior: 'smooth' }); } else { break; } } I am having multiple tabs and auto slide according to condition Continue reading...