nolanlum / notskype-qdb

0 stars 1 forks source link

Infinite scroll #25

Closed Speculative closed 7 years ago

Speculative commented 7 years ago

Pull & test this on as many browsers as you can pls (including mobile)

Adjective-Object commented 7 years ago

works on firefox and chrome for linux

If I remember correcty, high DPI scrollwheels (usually those on mac touchpads, magic mice) send way more scroll events than others, so you typically want to limit the polling speed with something like

lastTrigger = 0;
window.onscroll = () => {
    let now = new Date().getTime();
    if ( > lastTrigger + limit) {
        lastTrigger = now;
        doThing();
    }
}

or somesuch

Speculative commented 7 years ago

Did it. Fixed the infinite scroll bug I was having with iOS Safari that was making it load a lot of stuff when I triggered it for the first time.