-
Notifications
You must be signed in to change notification settings - Fork 32
Scroll start always from the top of the page rather than from the current position #25
Comments
Hey! Thanks for using the package and for your contribution. The problem is that the package detects current scroll position by evaluating To quickly fix this for your use case, just pass new Scroll(document.documentElement); and that should do the trick! Let me know if that works. |
Fix inaccurate current scroll position in #25
@crs1138 there seems to be a problem with your example. all of the In addition to that, I suspect there is something being done to the elements in the other JS files that is causing your page to redraw back to 0 in height. Either way, i'm not able to reproduce on the scroll-to-element demo, which seems to work fine even when clicking an elements further down on the page. Going to close this for now, but if you are able to remove the additional JS files and reproduce the issue using only this package, that will give me something concrete to help fix your issue. |
It is the combo of using it with Isotope2 that has been crucial to my project as I was looking for a way to bring focus to an expanded grid item. Without that, there's no need for the scrolling. Yes, Isotope positions absolutely all the items and I should have read your readme instruction more carefully. Thanks for the time you put in. |
I'm still experiencing this with 1.9.1 - therefore I opened #28 |
I am using Isotope2 and Scroll-JS on a project. There's a number of grid items in a Masonry layout. When a user clicks on a grid item it expands to full width and I want this item to scroll to the top of the viewport. My problem is that instead of scrolling from the current position within the page, the scroll starts from the top of the page. I've made a simplified case study in Codepen.
The text was updated successfully, but these errors were encountered: