'use strict'; { const next = document.getElementById('next'); const ul = document.querySelector('ul'); const slides = ul.children; // const slides = document.querySelectorAll('li'); // next.addEventListener('click', () => { // const slideWidth = slides[0].getBoundingClientRect().width; // ul.style.transform = 'translateX(-477px)'; // }); next.addEventListener('click', () => { const slideWidth = slides[0].getBoundingClientRect().width; ul.style.transform = 'translateX(${-1 * slideWidth}px)'; }); }