Hide the "Horizontal" scrollbar, but you can still scroll

I need help in hiding my horizontal scrollbar and still able to scroll it. I used webkit but does not work in IE and firefox. I saw a lot of help with a vertical scrollbar, but it doesn’t work with a horizontal one. Any help?

Update: I created a JSFiddle to show my problem. I want to hide the horizontal scrollbar and can still be scrolled without using

 ::-webkit-scrollbar { 
      display: none; 
   }

http://jsfiddle.net/o1xoh9w8/1/

+4
source share
1 answer

Here is how you do it, I tested it in Chrome, IE, Firefox, Opera, Safari (Windows) and Edge

<h1>You can scroll with mouse wheel</h1>

<div id="box">
    <div id="content">
        <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
    </div>
</div>

h1{font-weight:bold;font-size:2em;} /* ignore only for header */
/* *********************** */
div#box{
    height:200px;
    width:300px;     
    overflow:hidden;
    border:1px solid black;
    padding: 10px;
}

div#content{
    height:200px;
    width:326px;
    /*
     * Uncomment to see scrollbar
    width:300px;
    */
    overflow:auto;
}

Here is the JSFiddle: http://jsfiddle.net/JoshMesser/VUSuZ/

JsFiddle

EDIT:

. , , , , , . JS, . , p , , , .

http://jsfiddle.net/VUSuZ/575/

+1

All Articles