ApoorvSaxena/lozad.js

Compatibility with smooth scroll

elliott-impression opened this issue · 0 comments

Hello,

Expected Behavior

It should work as expected/normal behaviour when using a smooth-scroll library, for example locomotive-scroll.

Current Behavior

It does not work, which is likely because Lozad does not know the current scroll position.

Possible Solution

Option to detect by native (existing) scroll or by another means on desktop? I.e...

smoothScroll.on('scroll', (obj) => {
            updateScroll(obj.scroll.x, obj.scroll.y);
});

Here is an example of that: Preview / Code.

Steps to Reproduce (for bugs)

Just install Locomotive Scroll, and Lozad as normal.

Tested on:

Latest version of Chrome on Windows 10 and MacOS.