lozad.js icon indicating copy to clipboard operation
lozad.js copied to clipboard

Compatibility with smooth scroll

Open elliott-impression opened this issue 3 years ago • 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.

elliott-impression avatar Nov 06 '20 13:11 elliott-impression