Closed laugre closed 4 years ago
@laugre Hello
I am happy that you like it.
I am not sure if I understand you correctly.
Have you tried to add current
option?
What do you mean by current
option ?
I didn't find your documentation.
Sorry there is no documentation
let magicScroll = new MagicScroll({
speed: 80,
smooth: 12,
current: 200 // <-- here
});
My problem is I have a "goto top" button at the end of my web page to automatically scroll to the top of my page.
If I scroll down to the end and click my button the page well scroll to top with my method window.scroll({ top: 0, left: 0, behavior: 'smooth' });
But I use again mouse wheel, the page first scroll to the end before reacting to mouse wheel.
By using window.scroll(...) the position is not saved by your MagicScroll.
@laugre Okay I got it now.
can you try this?
magicScroll.pos = window.document.scrollingElement.scrollTop
Hello, thanks for the nice work. After using this on a website, I noticed exactly the same issue pointed out by Laugre. Here is a video to show the problem:
Where should I use this solution you provided? magicScroll.pos = window.document.scrollingElement.scrollTop
I noticed the same problem in your demo here: https://jsfiddle.net/mudin/2nstb5pf/ after scrolling, if you want to take control by dragging on the scrollbar before the scrolling stops, it will revert to it's last position.
Hi and thx a lot for this work :) I'm using it in my Gatsby website and it works like magic !
Sometimes I have to perform a smooth goto on my web page with this method
window.scroll({ top: elemPos + offSet, left: 0, behavior: 'smooth' });
And when I take back the control with my mouse, scroll position go back to last scroll position before my goto.
Do you know how to keep my scroll position ? Thx