ayamflow/virtual-scroll

It is not working at all. I would like an example of how to use it.

Closed this issue · 2 comments

pruge commented

I want to apply it to Logio.

npm i virtual-scroll -S
var section = document.querySelector('.log_screen.active .msg')
> <div class="msg">...</div>
var scroll = new VirtualScroll({el: section})

There is no change.
Should we do something more?

You need to implement your own logic for translating, based on the scroll values you receive in the event listener.
Here's a short DOM example:

var scrollY = 0
var scroll = new VirtualScroll({el: section})
scroll.on(onScroll)

function onScroll(event) {
    scrollY += event.deltaY
}

function update() {
    requestAnimationFrame(update)
    section.style.transform = 'translateY(scrollY)'
}

update()
pruge commented

thank you. But I gave up.