开发者

Help with scrollbar class

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜