How does rootMargin work in InViewport?
#308
Unanswered
victormihalache
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I can't really find anything in the docs about it. It only works with a string that ends in
px, but notrem... So where is it used in the code/how, as in: what values does it accept? Can it accept a multiple of the height of the target element?I am using this to show a floating button when the CTA in the hero section is not visible, but I found out that the requirement states that the floating CTA should be visible when the CTA in the hero is 3 times its height from the top (aka, if you can fit 3 times the button above it, don't show it, but if you go below these "phantom" buttons, it should show the floating CTA. I can kinda replicate it by putting a pixel amount, and I could compute it myself, but it seems... wrong.
Beta Was this translation helpful? Give feedback.
All reactions