dinamo zagreb

(389)

Jobs
Real Estate

Më të lexuarat

}); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ const wrapper = document.querySelector(".headline-subsections"); const container = wrapper?.querySelector(".sections-container"); if (!wrapper || !container) return; // Create arrows dynamically const leftArrow = document.createElement("div"); leftArrow.className = "arrow-indicator arrow-left"; leftArrow.innerHTML = ""; // using your arrow symbol const rightArrow = document.createElement("div"); rightArrow.className = "arrow-indicator arrow-right"; rightArrow.innerHTML = ""; // using your arrow symbol container.parentElement.style.position = "relative"; // positioning context container.parentElement.appendChild(leftArrow); container.parentElement.appendChild(rightArrow); function updateArrows() { const maxScroll = container.scrollWidth - container.clientWidth; if (maxScroll <= 0) { leftArrow.style.display = "none"; rightArrow.style.display = "none"; return; } leftArrow.style.display = container.scrollLeft > 5 ? "flex" : "none"; rightArrow.style.display = container.scrollLeft < maxScroll - 5 ? "flex" : "none"; } leftArrow.addEventListener("click", () => { container.scrollBy({ left: -250, behavior: "smooth" }); }); rightArrow.addEventListener("click", () => { container.scrollBy({ left: 250, behavior: "smooth" }); }); container.addEventListener("scroll", updateArrows); window.addEventListener("resize", updateArrows); // Run once on load updateArrows(); });