I am looking to display 3 out of my collection of over 6 articles, with the ability for the user to scroll from right to left when using the mouse wheel. Additionally, I want to hide the scrollbar for a cleaner look.
Can anyone assist me with this?
I have attempted some code but encountered the same issue. Could you please review it?
jQuery(function ($) {
$.fn.hScroll = function (amount) {
amount = amount || 120;
$(this).bind("DOMMouseScroll mousewheel", function (event) {
var oEvent = event.originalEvent,
direction = oEvent.detail ? oEvent.detail * -amount : oEvent.wheelDelta,
position = $(this).scrollLeft();
position += direction > 0 ? -amount : amount;
$(this).scrollLeft(position);
event.preventDefault();
})
};
});
$(document).ready(function() {
$('.full_screen_100').hScroll(60); // You can pass (optionally) scrolling amount
});
.horizontal_scroll .full_screen_100
{
width: 100%;
background-color: #fff;
overflow-y: visible;
overflow-x: auto;
white-space: nowrap;
vertical-align: text-top;
margin: 0;
padding: 0;
clear: both;
border-spacing: 5px;
}
.horizontal_scroll .full_screen_100 article{
width: 33%;
height: 100%;
display: inline-block;
border-left: solid 1px #E2E2E2;
display: table-cell;
}
#left_scroll{
overflow-y: visible;
overflow-x: auto;
white-space: nowrap;
vertical-align: text-top;
margin: 0;
padding: 0;
clear: both;
border-spacing: 5px
}
<div class="horizontal_scroll">
<div class="full_screen_100" id="left_scroll">
<article><div><p class="scroll_number">01</p><span class="page_slogan">Lorem ipsum dolor sit amet, </span></div></article>
<article><div><p class="scroll_number">02</p><span class="page_slogan">Lorem ipsum dolor sit amet, </span></div></article>
<article><div><p class="scroll_number">03</p><span class="page_slogan">Lorem ipsum dolor sit amet, </span></div></article>
<article><div><p class="scroll_number">04</p><span class="page_slogan">Lorem ipsum dolor sit amet, </span></div></article>
<article><div><p class="scroll_number">05</p><span class="page_slogan">Lorem ipsum dolor sit amet, </span></div></article>
<article><div><p class="scroll_number">06</p><span class="page_slogan">Lorem ipsum dolor sit amet, </span></div></article>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"><