javascript 什么是支持 iOS、Android、WP8 和下拉刷新功能的优秀 iScroll 替代方案?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14234037/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 21:06:20  来源:igfitidea点击:

What's a good iScroll alternative that supports iOS, Android, WP8 and pull-to-refresh functionality?

javascriptandroidiphonehtmliscroll

提问by Timo

I am looking for an alternative to iScroll for scrolling inside div's.

我正在寻找 iScroll 的替代方法,用于在 div 内滚动。

It needs to support these OS's:

它需要支持这些操作系统:

  • iOS
  • Android
  • WP8
  • IOS
  • 安卓
  • WP8

And I also need pull-to-refresh functionality.

而且我还需要下拉刷新功能。

Any suggestions?

有什么建议?

采纳答案by Timo

After days of evaluation, I came to the conclusion that there is no framework or library out there that fits all my needs. So, the only choice left was to create a custom solution for each operating system. This is what I came up with:

经过几天的评估,我得出的结论是,没有适合我所有需求的框架或库。因此,剩下的唯一选择是为每个操作系统创建自定义解决方案。这就是我想出的:

  • iOS< 5: iScroll
  • iOS>= 5: Native scrolling via CSS properties overflow-y:autoand -webkit-overflow-scrolling:touch. Pull-to-refresh via https://github.com/dantipa/pull-to-refresh-js
  • Android: iScroll
  • WP8: Native scrolling via overflow-y:auto. Own implementation for pull-to-refresh (very tricky).

回答by Samuli Hakoniemi

I'm not completely sure whether all the OS's are supported, but give it a try (it also has pull-to-refresh): http://zynga.github.com/scroller/

我不完全确定是否支持所有操作系统,但试一试(它也有下拉刷新):http: //zynga.github.com/scroller/

Also http://labs.ft.com/articles/ft-scroller/is worth of trying (supports your OS requirements), although I'm not aware of whether there's way to achieve pull-to-refresh easily.

此外http://labs.ft.com/articles/ft-scroller/是值得尝试(支持您的操作系统的要求),但我不知道是否有方法可以轻松地实现拉来刷新。