JSFiddle - React, Tailwind, and code Playground
HTML
<div id="main">
<img src="http://dummyimage.com/150x100/000/fff">
<img src="http://dummyimage.com/150x100/000/fff">
<img src="http://dummyimage.com/150x100/000/fff">
<img src="http://dummyimage.com/150x100/000/fff">
<img src="http://dummyimage.com/150x100/000/fff">
<img src="http://dummyimage.com/150x100/000/fff">
<img src="http://dummyimage.com/150x100/000/fff">
<img src="http://dummyimage.com/150x100/000/fff">
<img src="http://dummyimage.com/150x100/000/fff">
<img src="http://dummyimage.com/150x100/000/fff">
</div>
CSS
div {
overflow-x:scroll;
overflow-y:hidden;
white-space:nowrap;
}
JavaScript
$('#main').scroll(function (event) {
var width = $(this)[0].scrollWidth - $(this).width();
console.log('location: ' + $(this).scrollLeft() + ' out of ' + width);
});