javascript - how to hide moz scrollbar in dropdown menu -
.no-scroll::-webkit-scrollbar {display:none;} /* safari */ .no-scroll::-moz-scrollbars {display:none;} .no-scroll::-o-scrollbar {display:none;} /* opera */ .no-scroll::-google-ms-scrollbar {display:none;} .no-scroll::-khtml-scrollbar {display:none;}
i have ul , li tags drop-down , ul have max-height:400px , after display horizontal scrollbar. want scroll effect not scrollbar.
i have success in chrome in mozila not works properly
can me please ...
one way using div cover scrollbar. add div same background-color container, , place on top of scrollbar. suggest using javascript or preferably jquery position div , remember make 2 elements overlapping; can done setting both of positions absolute instance (and container's position relative).
here's quick example:
https://jsfiddle.net/jffe4sy3/1/
it's not pretty or generic, works in cases.
html:
<select id="select_id" class="select" size="5"> <option value="1" >test1</option> <option value="2" >test2</option> <option value="3" selected>test3</option> <option value="4" >test4</option> <option value="5" >test5</option> </select> <div id="div_id" class="cover"></div>
css:
.select{ height:60px; //set max-height (i.e. max-height:400px;) position:absolute; } .cover { background-color:white; position:absolute; border-left:solid grey 1px; width:16px; }
javascript/jquery:
$("#div_id").height($("#select_id").height()+2); // height of select + 2px include border $("#div_id").css("margin-left", $("#select_id").width()-15); // width of select minus scrollbar
however suggest use display:none
option when applicable! should use solution in rare case isn't.
Comments
Post a Comment