venom1996,
минимальная версия ... -50 : 50; при желании можно изменить
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.slider {
width: 100vww;
height: 200px;
overflow: hidden;
}
.line {
background-color: #00FFFF;
display: flex;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
let elem = document.querySelector(".slider"),
line = document.querySelector(".line"),
x = 0;
function move(event) {
event.preventDefault();
var delta = event.deltaY || event.detail || event.wheelDelta;
x += 0 <= delta ? -50 : 50;
setX()
}
function setX()
{
x = Math.max(0, Math.min(line.scrollWidth - elem.clientWidth, x));
line.style.transform = "translateX(" + -x + "px)"
}
elem.addEventListener("mousewheel", move);
elem.addEventListener("DOMMouseScroll", move);
window.addEventListener("resize", setX);
})
</script>
</head>
<body>
<div class="slider">
<div class="line">
<img src="https://picsum.photos/200/200?1">
<img src="https://picsum.photos/200/200?2">
<img src="https://picsum.photos/200/200?3">
<img src="https://picsum.photos/200/200?4">
<img src="https://picsum.photos/200/200?5">
<img src="https://picsum.photos/200/200?6">
<img src="https://picsum.photos/200/200?7">
<img src="https://picsum.photos/200/200?8">
<img src="https://picsum.photos/200/200?9">
</div>
</div>
</body>
</html>