Comments (5)
Hey! Thanks for using the package and for your contribution. The problem is that the package detects current scroll position by evaluating document.body.scrollTop
. But doesn't consistently return the correct scroll distance and is discouraged in modern browsers (in strict mode anyway).
To quickly fix this for your use case, just pass document.documentElement
to the Scroll
constructor instead of document.body
.
new Scroll(document.documentElement);
and that should do the trick! Let me know if that works.
from scroll-js.
@crs1138 I've opened #27 to fix this issue. Do you mind pulling that down and verifying that it fixes your issue?
from scroll-js.
@crs1138 there seems to be a problem with your example. all of the grid-items
are absolutely positioned and the parent element (<body>
in your example) has no overflow content. Per README, your parent element needs to always have overflow content.
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.
from scroll-js.
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.
from scroll-js.
I'm still experiencing this with 1.9.1 - therefore I opened #28
Unfortunately using document.documentElement
will not work on Safari...
Feel free to close my duplicate and reopen this.
from scroll-js.
Related Issues (20)
- Errors with brunch HOT 6
- Container.contains is not a function HOT 2
- Duration: 0? HOT 8
- Offset option HOT 17
- Massive NPM package HOT 3
- Stop scrolling immediately. HOT 4
- Scrolling always starts at the top for Chrome and Firefox HOT 4
- other easing options HOT 3
- Support more ScrollIntoViewOptions per specification
- Remove support for instant behavior
- Holp to support `top` into ScrollIntoViewOptions HOT 1
- Behavior of `behavior` HOT 2
- Why does this package has a minimal node engine version HOT 6
- IE11 Support HOT 3
- On nextjs it runs in development mode. HOT 2
- Import error "cannot find module" HOT 5
- Feature Request: `cancel` method
- Feature Request: `scrollBy` method
- scrollIntoView not working in IE HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scroll-js.