Skip to content

[Help]: Carousel freezes when using transform with intersection observer from VueUse #966

Closed Answered by davidjerleke
michaelprys asked this question in Help
Discussion options

You must be logged in to vote

I’m not sure if adding a div with :class="{ 'fade-in-up': isVisible }" inside <CarouselItem> is the optimal solution, as adding dynamic classes to a large number of items in a loop can potentially impact performance. However, it does solve the issue.

@michaelprys I'm not sure you have realistic expectations. Embla makes minimal changes to the DOM. There are only two ways it affects the DOM:

  1. It sets transform: translate3d to the container to create the scroll effect.
  2. It sets transform: translate3d on slides that need to shift position in order to create the loop effect.

That's all and it's a lot less compared to most carousel libraries. As long as you don't apply styles that affects el…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@michaelprys
Comment options

@davidjerleke
Comment options

Answer selected by davidjerleke
@michaelprys
Comment options

@davidjerleke
Comment options

Comment options

You must be logged in to vote
1 reply
@davidjerleke
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
resolved This issue is resolved question Question about how to achieve something vue Issue is related to Vue
2 participants