Skip to content
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

alwaysShow - true still generates an oversized handle #8

Open
janmast opened this issue Mar 3, 2011 · 0 comments
Open

alwaysShow - true still generates an oversized handle #8

janmast opened this issue Mar 3, 2011 · 0 comments

Comments

@janmast
Copy link

janmast commented Mar 3, 2011

Hi,
for the alwaysShow option : it still gives me two bugs.

  1. if set to true : the handle gets calculated wrongly : a DIV with hight 400px and with 10px content gives a ratio of 400 / 10 = 40. this generates a handle of 400 * 40. OK, you don't see it ... but I prefer not to have this kind of hidden items.

  2. I can still scroll the content of that same div ! even if there is nothing to scroll. that is because the same div gives a range of : 10 - 200 = -190. resulting in a scrollable div in safari using mousewheel.

I suggest the next solutions :

//handleSize = +this.scroller.scroll.getDimensions()[this.axis] * ratio;

if (ratio >= 1 && true == this.options.alwaysShow) {
handleSize = this.areaSize;
this.maxRange = 0;
} else {
handleSize = +this.scroller.scroll.getDimensions()[this.axis] * ratio;
this.maxRange = this.scrollSize - this.areaSize / 2 + this.options.margin;
}

and :

// this.slider = new Slider(this.scroller.scroll, this.scroller.handle, {mode: this.options.mode,range: [0, this.scrollSize - this.areaSize / 2 + this.options.margin]});

this.slider = new Slider(this.scroller.scroll, this.scroller.handle, {
mode: this.options.mode,
range: [0, this.maxRange]
});

keep it up,
J

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant