-
Notifications
You must be signed in to change notification settings - Fork 523
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
Positive rootMargin doesn't seem to work #260
Comments
Since this is against the native implementation and not the polyfill, it's best to file bugs against the browsers themselves rather than against the spec. That being said, I see the issue you're pointing out in CodePen, but I can't reproduce it when running the exact same test in a plain HTML file. Since CodePen runs these in an iframe, maybe there's some issue there. Either way, it's probably best to file an issue with the individual browsers. |
OK no prob. Weird, it now works for me in a plain HTML file too. Now to see why it didn't work originally in our app... Thanks! |
It turned out to be CSS that was the problem in our app. Our I've removed So maybe it's do with how |
Sorry to revive such an old post but just in case someone is stumbling across this from Google, my issue was that if the root element is in an iframe (which is the case with JSFiddle!), then it has to be given an explicit |
@parkjoon any chance you could share a link to a working fiddle? Nothing I can come up with (in a fiddle) works in the current version of Chrome 😐 |
Well i had exactly the probleme described, and yes the codepen iframe was not working, but even in a plain .html file, But if i set the |
But sometimes we need to use |
I want to trigger the intersection observer early, let's say
100px
early, but I can't seem to. I'm testing in Chrome & Firefox.If I set
rootMargin
to0px 0px -100px
, it doesn't fire until I scroll down 100 pixels late / past the top of the element as expected. Pen: https://codepen.io/adam-lynch/pen/GMBeVj.But if I set
rootMargin
to0px 0px 100px
, it doesn't fire early and seems to behave exactly the same as if I setrootMargin
to0px
. Pen: https://codepen.io/adam-lynch/pen/eGjoXY.If I set
rootMargin
to100px 0px 0px
, it doesn't fire early and seems to behave exactly the same as if I setrootMargin
to0px
. Pen: https://codepen.io/adam-lynch/pen/VMBNRW.This might be related to #157 but I'm not sure.
The text was updated successfully, but these errors were encountered: