1 | var Scroller = require('../')
|
2 | var pull = require('pull-stream')
|
3 | var h = require('hyperscript')
|
4 |
|
5 | var content = h('div')
|
6 | var scroller = h('div', {
|
7 | style: {
|
8 |
|
9 | 'overflow-y': 'scroll',
|
10 |
|
11 |
|
12 | position: 'fixed', bottom:'0px', top: '0px',
|
13 | 'margin-left': 'auto',
|
14 | 'margin-right': 'auto',
|
15 | width: '600px'
|
16 | }
|
17 | }, content)
|
18 |
|
19 |
|
20 | function render (n) {
|
21 | return h('h1', n.toString())
|
22 | }
|
23 |
|
24 | pull(
|
25 | pull.infinite(),
|
26 | Scroller(scroller, content, render)
|
27 | )
|
28 |
|
29 | document.body.appendChild(scroller)
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|