开发者

Having the scrollbar handle sized in relation to the content height

I'm having a bit of trouble with this logic. My setup is typical, with a content MC and a handle MC the runs along a t开发者_如何转开发rack with specified bounds. All I want to do is have the handle height adjust based on content height but in relation to the track height?

I'm just not sure how to tackle this idea.


if :

contentHeight = 200 (height of the content)

visibleAreaHeight = 100 (height of the visible area)

scrollBarHeight = 100 (height of the Scrollbar)

then the height of the scrollbar handle is :

handleHeight = (visibleAreaHeight / contentHeight) * scrollBarHeight // 50

The height of the handle represents the visible tip of contents.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜