// Get the scroll container element
const scrollContainer = document.querySelector('.scroll-container');
// Get the buttons
const scrollLeftButton = document.getElementById('scrollLeft');
const scrollRightButton = document.getElementById('scrollRight');
// Set the amount to scroll per click (in pixels)
const scrollAmount = 200; // Adjust this value as needed
// Add event listener to the "Scroll Left" button
scrollLeftButton.addEventListener('click', function() {
scrollContainer.scrollLeft -= scrollAmount; // Scroll to the left
});
// Add event listener to the "Scroll Right" button
scrollRightButton.addEventListener('click', function() {
scrollContainer.scrollLeft += scrollAmount; // Scroll to the right
});