Skip to content
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

Trigger visibility 200px before it shows up in the viewport. #217

Open
mrcl opened this issue Jun 24, 2020 · 1 comment
Open

Trigger visibility 200px before it shows up in the viewport. #217

mrcl opened this issue Jun 24, 2020 · 1 comment

Comments

@mrcl
Copy link

mrcl commented Jun 24, 2020

I would like to trigger loading the data of a component slightly before it shows up in the viewport.
Reading the IntesectionObserver documentation it seemed that this could be achieved by increasing the bottom margin of the root, using the rootMargin option ('0px 0px 200px 0px'). But I probably am mistaken as I could not make it work.

Is there a proper way to do it using vue-observe-visibility?

Cheers

@RayanIJ
Copy link

RayanIJ commented Aug 14, 2020

<div class="card" v-observe-visibility="{ callback: (isVisible, entry) => visibilityChanged(isVisible, entry), intersection: { rootMargin: '200px' } }">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants