-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scroll-Area has wrong height, when around a div using ng-scrollbar a parent div is used #18
Comments
Hi, Can you please post a gist or plunker that I can play with ? Thanks |
@stnswz I found out that the height is being calculated like this "page.height = element[0].offsetHeight - parentOffsetTop;". That's why the height of the scrolling area is not the same as the scrollDiv height, cause it removes the parentOffsetTop from those "250px" that you've set as height. What I did to fix this (not saying is the right way but it works for me) is I've set the page.height to be equal to the child height in other words I did this "page.height = element[0].firstChild.clientHeight;" |
Hi, I really cant understand what the reason for this missbehave is, but its a very annoying bug and never should be the behave of a scrollbar. Just try simply using a DIV around the DIV that uses ng-scrollbar:
(style)
.parentDiv {
width:550px;
height:300px;
background-color:#444444;
}
.scrollDiv {
height: 250px;
width: 500px;
border-style:solid;
border-width:1px;
border-color: #ff0000;
background-color:#777777;
overflow:hidden;
}
(/style)
(div class="parentDiv")
(/div)
The result is that the scrolling area in scrollDiv is not 250 px height as you would expect, instead its only around the half. Remove the parent div and the scrolling area is ok. Expected is that the scrollbar has the same height as it is set for the scrollDiv, but its not when the parent div is around. It doesnt make any sense to me and really absolutely should not be the behave of a scrollbar. Why is that? And how to get around this?
The text was updated successfully, but these errors were encountered: