鍍金池/ 問答/HTML/ 移動端h5頁面長列表滾動問題

移動端h5頁面長列表滾動問題

前置:

  • 安卓端的h5頁面
  • 長列表滾動

兩個問題:

1.移動端的長列表滾動直接像瀏覽器一樣用原生/默認的滾動不行么?

2.為什么有的h5頁面非要用iscroll這樣的js插件來實現(xiàn)呢?

這里只限定滾動(不考慮滾動加載之類的效果)

回答
編輯回答
柚稚
Even on platforms where native scrolling is good enough, iScroll adds
features that wouldn't be possible otherwise. Specifically:

Granular control over the scroll position, even during momentum. You
can always get and set the x,y coordinates of the scroller. Animation
can be customized with user defined easing functions (bounce, elastic,
back, ...). You can easily hook to a plethora of custom events
(onBeforeScrollStart, onScrollStart, onScroll, onScrollEnd, flick,
...). Out of the box multi-platform support. From older Android
devices to the latest iPhone, from Chrome to Internet Explorer.

簡單說就是,iscroll具有:

  1. 細粒度控制,可以實時獲取x,y坐標。
  2. 可以定制多種動畫模型
  3. 有許多好用的鉤子,例如onScrollStart...
  4. 跨平臺性。

此外,iscroll會根據(jù)設備和瀏覽器的不同,選擇性能最佳的方式進行模擬滾動。

2017年12月9日 00:08
編輯回答
未命名

安卓的原生滾動沒有運動曲線,非常生硬.
滾動插件提供了一些邊界回彈之類的原生沒有的效果

最主要的是在幾年之前,原生不支持在固定區(qū)域內(nèi)滾動...

2017年4月14日 03:20