I need some help with hiding my horizontal scrollbar and still able to scroll. I have used webkit but does not work in IE and firefox. I have seen alot of help with vertical scrollbar, but does not work with horizontal. Any help?
Update: I have created a JSFiddle to show my problem. I want to hide the horizontal scrollbar and still able to scroll without using
::-webkit-scrollbar {
display: none;
}
http://jsfiddle.net/o1xoh9w8/1/
Hide Scrollbars But Keep Functionality IE and Edge supports the -ms-overflow-style: property, and Firefox supports the scrollbar-width property, which allows us to hide the scrollbar, but keep functionality.
Under Display options for this workbook, clear or select the Show horizontal scroll bar check box and Show vertical scroll bar check box to hide or display the scroll bars.
To hide the horizontal scrollbar and prevent horizontal scrolling, use overflow-x: hidden: HTML. CSS.
Click Start > Settings. Under Windows Settings, scroll down, and then click Ease of Access > Display. Scroll down, and then set Automatically hide scroll bars in Windows to Off.
I used a fixed height approach.
Note: this approach can help only in specific cases.
#container1{
height: 50px;
/* Just for presentation. Can be removed */
border: 1px solid red;
/* Hides content outside this container */
overflow: hidden;
}
#container2{
/* Height is significantly greater than the height of container#1 to hide
any possible scroll */
height: 100px;
overflow: auto;
white-space: nowrap;
}
<div id="container1">
<div id="container2">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam hendrerit, ante laoreet mattis blandit, arcu nisi blandit felis, et molestie justo lacus et sem. Nunc tempor tellus sit amet eleifend tristique. Integer eget condimentum lectus, nec viverra risus. Nullam leo lectus, placerat vitae porta eget, auctor et nisi. Suspendisse feugiat in lacus accumsan tincidunt. Fusce pulvinar accumsan sem sit amet finibus. Curabitur volutpat mi vitae eros mattis congue. In ut sem eu tellus egestas lobortis vitae eu felis. Maecenas sodales, nisl eu bibendum vulputate, neque leo finibus odio, sit amet bibendum libero dolor sed diam. In molestie magna vitae dui vulputate, eu consequat dui ullamcorper. In hac habitasse platea dictumst. Vestibulum pulvinar, mi quis mollis pulvinar, metus justo aliquet arcu, vel venenatis ipsum dolor at sapien. Sed ac odio bibendum, feugiat nibh at, viverra mi. Morbi sem nisi, ultricies non nulla pretium, gravida malesuada neque.
</div>
</div>
(My case is horizontal scrollable buttons container for mobile screens - the buttons are stuck to the above block (+ margin) and have fixed height)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With