A web component based on iOS's UITableView
npm install lazy-scroll html
`
index.js
` javascript
var LazyScroll = require('lazy-scroll')var MyScroller = {
prototype: Object.create(LazyScroll.prototype)
}
MyScroller.prototype.createdCallback = function () {
LazyScroll.prototype.createdCallback.call(this)
this.direction = 'vertical' // vertical|horizontal
this.itemCount = 100 // the number of items in your list
this.itemSize = 50 // the size of each item
this.overflow = 0 // the number of items to buffer offscreen
this.update()
}
MyScroller.prototype.itemAtIndex = function (index) {
var item = document.createElement('DIV')
item.textContent = index
return item
}
document.registerElement('my-scroller', MyScroller)
``