-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using with smooth scrolling libraries #10
Comments
Screen.Recording.2022-08-19.at.3.12.31.AM.mov |
Thanks! Is the smooth scrolling library using on your page? |
Yes, I am using the locomotive-scroll library. |
Using smooth scrolling libraries leads to this result, since the browser does not recalculate (on custom scrolling) mouseenter/mouseleave events, css hovers, etc. The only suggestion I can make is to try and force a reflow/redraw at the end of the scroll to force the browser recalculate the "hover events". Example (need tune): import LocomotiveScroll from 'locomotive-scroll';
import debounce from 'lodash-es/debounce';
const scroll = new LocomotiveScroll({
el: document.querySelector('[data-scroll-container]'),
smooth: true
});
const reflow = () => {
const el = document.querySelector('.c-scrollbar'); // some visible element on page
el.style.display = 'none';
for(let i = 0; i < 3; i++) el.offsetHeight;
el.style.display = 'block';
};
const reflowDebounced = debounce(reflow, 50);
scroll.on('scroll', () => {
reflowDebounced();
}); |
Thank you @Drafteed, I will try and let you know. |
This solution isn't working for me, unfortunately. I'm using the Lenis library [https://github.com/studio-freight/lenis]. When the cursor hides after morphing to text mode. |
Hello! it's an amazing library.
I have some issues when working with safari. If I hover the cursor over an image, text appears or when I hover over links or buttons, the cursor decreases. The problem is that if I scroll down, the cursor remains in the same state. Everything works fine in google chrome. Maybe I missed something.
The text was updated successfully, but these errors were encountered: