lazy-scroll
A web component based on iOS's UITableView.
Why
If you have a huge list, or just want to keep your resource consumption low.
How
The idea is to load items that are about to scroll into view on demand, and to unload items that are no longer visible.
Example
index.html
index.js
var LazyScroll =var MyScroller =prototype: ObjectMyScrollerprototype {LazyScrollprototypecreatedCallbackthisdirection = 'vertical' // vertical|horizontalthisitemCount = 100 // the number of items in your listthisitemSize = 50 // the size of each itemthisoverflow = 0 // the number of items to buffer offscreenthis}MyScrollerprototype {var item = documentitemtextContent = indexreturn item}document
Releases
- 2.x
- Most browsers have figured out how to deal with pointer-events by now, so just emit scroll{start,end} events instead of disabling them explicitly.
License
WTFPL