Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
157
rated 0 times [  162] [ 5]  / answers: 1 / hits: 158607  / 10 Years ago, sat, august 2, 2014, 12:00:00

I have a div with element styles like this:



 <div style=overflow-y: auto; max-height: 300px;>< id=DivTableContainer ></div>


I need to allow scrolling along the y-axis when it becomes higher than 300px, this works fine. But I need to set visiblity = false to scroll bar itself.



I tried to use this element style:



overflow-y: hidden;


While it hides the scroll bar, it also disallows scrolling. Is there a way to get scrolling without having the scrollbar visible?


More From » html

 Answers
11

It's better, if you use two div containers in HTML .



As Shown Below:



HTML:



<div id=container1>
<div id=container2>
// Content here
</div>
</div>


CSS:



 #container1{
height: 100%;
width: 100%;
overflow: hidden;
}

#container2{
height: 100%;
width: 100%;
overflow: auto;
padding-right: 20px;
}

[#69946] Thursday, July 31, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
madelyn

Total Points: 449
Total Questions: 100
Total Answers: 100

Location: Seychelles
Member since Fri, May 7, 2021
3 Years ago
madelyn questions
Wed, Jul 28, 21, 00:00, 3 Years ago
Wed, Jul 14, 21, 00:00, 3 Years ago
Sat, Nov 7, 20, 00:00, 4 Years ago
Thu, Sep 3, 20, 00:00, 4 Years ago
;