寻找 iScroll 的替代品(iOS/Webkit 上的滚动 Div)

发布于 2024-11-18 02:47:16 字数 439 浏览 7 评论 0原文

我通过数据移动应用程序构建了一个复杂的表单,现在正在寻找一种解决方案来保留标题和页脚栏的位置。在我的虚拟模型中,它是在桌面上使用 Chrome 和 Safari 开发和测试的,我只是将页眉和页脚以及内容部分定位为绝对位置,其高度由 JavaScript 在 Windows 的调整大小事件中设置。

对于移动世界来说,这不是正确的方法,因为移动 WebKit 不支持 Overflow:auto。

我自己尝试了一些东西,也看了 iScroll。事实上,iScroll 使我的 iPad 上的 safari 崩溃,而没有该组件的应用程序运行得相当流畅。我有很多相对复杂的表格,这对iScroll来说可能是一个挑战,我认为这是赢不了的。

因此,我正在寻找其他方法来实现我的目标(保留页眉和页脚),而不让用户使用两根手指进行滚动(事实上,几乎没有人知道这个“技巧”)。

有什么建议吗?

谢谢!

I built a complex forms over data mobile application and am now looking for a solution to persist the position of the title and the footer bar. In my dummy, which has been developed and tested with Chrome and Safari on my desktop, I just positioned the header and the footer absolute, as well as the content section, which height is set by JavaScript on the windows' resize event.

That's not a proper way for the mobile world, because overflow:auto isn't supported on mobile WebKit.

I tried some things by my own and I took also a look at iScroll. In fact, iScroll crashed safari on my iPad while the application without that component runs quite smooth. I have a lot of relatively complex forms, which may be a challange for iScroll, which can't be won I think.

So I am looking for other ways to achieve my goal (persist header and footer) without letting the user use two fingers for scrolling (in fact, almost nobody knows that "trick").

Any suggestions?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

猫性小仙女 2024-11-25 02:47:16

所以常见的解决方案有以下三种:

  1. iScroll
  2. YUI ScrollView
  3. 滚动性

他们'关于一切都非常适合滚动简单的列表。但是,如果其目的是处理包含多个列表的整页(例如具有动态表单的复杂对话框等),则没有人真正有效。

我决定放弃并等待一年 - 苹果最近宣布支持position:fixed和overflow:scroll,这将彻底改变这部分并解决我们今天遇到的所有此类问题。

今天我想起我们慕尼黑大楼里的一家公司的网站,用iPad打开它,确实,它的首页有一个可滚动的新闻部分。所以我往里面看,发现它正在使用... tadaaa ... jScrollPane

我不认为 jScrollPane 是为在移动设备上使用而开发的,但它也为此目的进行了优化。它仅适用于我的 iPad、Android 2.3 以及最新的 Opera Mobile。

它不像在移动设备上滚动本机应用程序,但它允许您看到完全可定制的滚动条,跳到顶部和底部,最重要的是,用一根手指滚动

很不错。

So there are three commonly mentioned solutions:

  1. iScroll
  2. YUI ScrollView
  3. Scrollability

They're all very neat for scrolling through simple lists. But no one really works if it's purpose is to handle full pages with more than just a list, for example complex dialogs with dynamic forms and so on.

I just decided to give up and wait a year - Apple has lately announced its support for position:fixed and overflow:scroll, which will revolutionize this part and solve all that kind of problems we have today.

Today I remembered a website of a company in our building here in Munich, opened it with the iPad, and indeed, it had a scrollable news section on its frontpage. So I looked inside and saw that it is using ... tadaaa ... jScrollPane.

I don't think jScrollPane was developed for using it on mobile devices, but it has been optimized for that purpose, too. It just works on my iPad, my Android 2.3 and also on the latest Opera Mobile.

It doesn't feel like scrolling a native app on a mobile device, but it allows you to see a fully customizable scrollbar, jump to top and to buttom and, what's most important, to scroll with one finger.

Very nice.

二智少女猫性小仙女 2024-11-25 02:47:16

Mobile webkit 现在仅支持使用 CSS 进行滚动。创建一个“scrollable”类并添加以下规则:

    .scrollable {
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }

将“scrollable”类添加到任何需要滚动的块元素。仅限 Webkit。

Mobile webkit now supports scrolling using only CSS. Create a class 'scrollable' and add the following rules:

    .scrollable {
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }

Add your 'scrollable' class to any block element that requires scrolling. Webkit Only.

誰ツ都不明白 2024-11-25 02:47:16

https://github.com/filamentgroup/Overthro/

基于轻量级填充的解决方案,让现代浏览器具有溢出功能:scroll 支持做他们的事情。

仍处于开发早期阶段,但在最大的受影响用户群(android 2.2/2.3/iOS<5)上运行良好。

https://github.com/filamentgroup/Overthrow/

Lightweight polyfill based solution that let's modern browsers with overflow:scroll support do their thing.

Still in early phase of development, but works pretty well on the largest affected user base (android 2.2/2.3/iOS<5).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文