JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<div class="wrapper">
<div class="box">Item1</div>
<div class="box">Item2</div>
<div class="box">Item3</div>
<div class="box">Item4</div>
</div>
</div>
<script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src='https://css-tricks.com/examples/HorzScrolling/jquery.mousewheel.js'>
CSS
.container {
width: 100vw;
margin:0;
}
.wrapper {
overflow: hidden;
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
word-spacing: -10;
}
.box {
display: inline-block;
height:100vh;
width: 40vw;
background-color: white;
border:1px solid black;
text-align: center;
vertical-align: center;
margin:0;
}
.box img{
height: 100%;
object-fit: cover;
overflow: hidden;
}
JavaScript
$(function() {
$(".wrapper").mousewheel(function(event, delta) {
this.scrollLeft -= (delta * 10);
event.preventDefault();
});
});