|
I cannot exactly figure out how the scroll position is measured.
I have a container with a specific height (400) and some elements (30) in it with specific heights (18). The container displays about 7.2 items in it. The maximum scroll position in firefox is 142. In chrome 141.
If the container can display an exact number of items then the calculation is simple: number-of-items * item-height - container-height.
But how is it calculated if the container displays 7.2 items?
And worse, if the container has padding top and bottom?
See this example[^]
[edit]
The reason why I want this is because I want some kind of ScrollBar. I have it kind of working, but there are differences in browsers.
In firefox, this example works: http://jsfiddle.net/woomla/ma88D/7/[^]
In chrome this example workds: http://jsfiddle.net/woomla/ma88D/8/[^]
The difference is that in the chrome version I need to add padding-top and padding-bottom to the max scroller distance. In firefox I need to add only padding-top.
modified 18-Dec-12 7:05am.
|
|
|
|
|
What about rounding your items count up from 7.2 to 8 ?
And then calculating the height based on that?
|
|
|
|