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

Maintain the height of an element when it is out with Vue #29

Closed
florian-lefebvre opened this issue Jan 10, 2021 · 5 comments
Closed

Maintain the height of an element when it is out with Vue #29

florian-lefebvre opened this issue Jan 10, 2021 · 5 comments

Comments

@florian-lefebvre
Copy link

Hello, I use AnimXYZ in my Vue project. I made a component to trigger the animation when scrolling using the Intersection Observer API but my problem is that AnimXYZ reduces the element where I have v-if="show" when it's false. Is it possible to keep the height of the original element and the animation ?

@mattaningram
Copy link
Member

You can have the intersection observer apply the xyz-in or xyz-appear class to the elements you want to animate instead of using v-if or v-show logic. Let me know if that works.

@florian-lefebvre
Copy link
Author

florian-lefebvre commented Jan 10, 2021

Yes, I just replaced v-if="show" by :class="show ? 'xyz-in' : 'xyz-out'" and it worked. Thanks!

@florian-lefebvre
Copy link
Author

This is now useless, use appear-visible attribute. See https://animxyz.com/docs#vue-xyz-transition.

@ricky11
Copy link

ricky11 commented Jan 10, 2022

is this such a thing as disappear? i know there isn't as vue doesn't have it, but i would like to animate out when the intersection observer detects when the div is almost out of view (i am using vue)

@florian-lefebvre
Copy link
Author

@ricky11 I think you should look at appear-visible properties: https://animxyz.com/docs#vue-xyz-transition, and in particular the IntersectionObserverOptions.

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

3 participants