更换的ScrollPane滚动条与OS本地滚动条 [英] Replacing ScrollPane Scrollbar with OS Native Scrollbar

查看:143
本文介绍了更换的ScrollPane滚动条与OS本地滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种简单的方法来与操作系统的本机滚动条取代的ScrollPane滚动条?

Is there an easy way to replace the ScrollPane scrollbar with the OS's native scrollbar?

Flash应用程序看起来更加完整,如果他们有相同的蒙皮为用户的操作系统 - 这并不总是容易察觉(Vista的Aero与经典?)

Flash applications look much more integrated if they have the same skinning as the user's operating system -- which isn't always easy to detect (Vista Aero vs. Classic?).

有你们遇到的闪存任何实例的应用程序这样做呢?

Have you guys come across any examples of Flash apps doing this?

推荐答案

有关的好奇,我们分开ScrollPane组件成为一个独立的SWF和放置一组沿着正确和小部件的底侧两个嵌套的div。

For the curious, we separated the scrollpane component into a self-contained swf and placed a set of two nested divs along the right and bottom side of the widget.

使用垂直滚动条作为一个例子,外格设置为滚动窗格的高度,不得不的CSS 溢出 - X 隐藏,和溢出-Y 汽车的。孩子股利然后设置为某个任意宽度和高度等于在滚动的内容的像素高度。

Using the vertical scrollbar as an example, the outer div was set to the height of the scrollpane and had a CSS overflow-x of hidden, and an overflow-y of auto. The child div was then set to some arbitrary width and a height equal to the height in px of the scrollpane's content.

浏览器会显示一个适当大小的滚动握,我们可以快速读取垂直滚动的外格偏差知道多远,以抵消闪存滚动窗格。同样的技术,通过适当的修改,用于水平滚动条。

The browser would display an appropriately sized "scroll grip" and we could quickly read the vertical scroll offset on the outer div to know how far to offset the Flash scrollpane. The same technique, with appropriate modifications, was used for the horizontal scrollbar.

我们还包括一些逻辑来自动隐藏根据他们的溢出容器。结果密切配合本机操作系统的行为pretty的。

We also included some logic to auto-hide the containers based on their overflow. The result matched native OS behavior pretty closely.

虽然这听起来像一个巨大的黑客攻击,我们能够广泛地部署解决方案( scribd.com )没有什么大的问题。

While this may sound like a huge hack, we were able to widely deploy the solution (scribd.com) without any major issues.

这篇关于更换的ScrollPane滚动条与OS本地滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆