开发者

Help with scrollbar class

开发者 https://www.devze.com 2023-01-30 08:50 出处:网络
Here is the scrollbar class in question: http://jsfiddle.net/brandondurham/6SUyM/3/ Currently the height of the scroll handle is dynamic and determined by the amount of content, much like a standard

Here is the scrollbar class in question: http://jsfiddle.net/brandondurham/6SUyM/3/

Currently the height of the scroll handle is dynamic and determined by the amount of content, much like a standard browser scrollbar. I need to be able to make this static (200px), regardless of t开发者_运维知识库he amount of content. You can see in the code where I tried to set the height, but when I did that the handle would land in strange places when dragging.

Suggestions for making that height static instead of dynamic?


In the update "section"/function:

this.vThumbSize = (this.vTrackSize * this.vContentRatio).limit(12, this.vTrackSize);
this.vThumb.setStyle('height', 200);

this.vScrollRatio = this.vContentScrollSize / this.vTrackSize+this.vThumbSize;

This will set the scroll to 200px


This ended up being the answer:

this.vScrollRatio = this.vContentScrollSize / (this.vTrackSize - this.vThumbSize) - this.vContentRatio * (this.vContentScrollSize / (this.vTrackSize - this.vThumbSize));
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号