AlreadyM / jscrollpane

Automatically exported from code.google.com/p/jscrollpane
0 stars 0 forks source link

Scrollbar gets applied even when not necessary #155

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The extra padding required to display the scrollbar is applied to the
container BEFORE determining whether or not the scrollbar is needed.  

var p = this.originalSidePaddingTotal;
var realPaneWidth = paneWidth - settings.scrollbarWidth -
settings.scrollbarMargin - p;

cssToApply = {
    'height':'auto',
    'width': realPaneWidth + 'px'
}

This results in the scrollbars being applied in cases where it is not
necessary.  In fluid layouts (like our Fonolo widget) the content will
actually get shorter when the height of a container is increased in order
to remove the scrollbar.

I have a solution, but I don't know where to post it yet.  Before the
'percentInView' calculation, only set the height:auto attribute, then in
the proceeding if block, apply the space for the scrollbars as above, then
recalculate contentHeight and percentInView since they are used to build
the rest of the interface.

Reza Shaffaf
Web Developer
Fonolo.com

Original issue reported on code.google.com by reza.sha...@gmail.com on 4 Dec 2009 at 12:27

GoogleCodeExporter commented 9 years ago
Here is my solution heavily commented from lines 127 to 188 from the original
download of jscrollpane-1.2.3.js

This works, but it could probably be done more elegantly ;)

Reza

Original comment by reza.sha...@gmail.com on 4 Dec 2009 at 9:35

Attachments:

GoogleCodeExporter commented 9 years ago
I have just announced the beta of a completely rewritten version of jScrollPane:

http://groups.google.com/group/jscrollpane/browse_thread/thread/c1bc1bf63e3f80d8

Please test and reply on the list if you are still having this issue,

Thanks,

Kelvin

Original comment by kelvin.l...@gmail.com on 17 Aug 2010 at 4:15