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

Enabling Container param on useLottieInteractivity #40

Open
migsdeving opened this issue Nov 25, 2021 · 3 comments
Open

Enabling Container param on useLottieInteractivity #40

migsdeving opened this issue Nov 25, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@migsdeving
Copy link

Is your feature request related to a problem? Please describe.
Yes, I want to make a lottie play with scroll but instead of listening to the lottie container's viewport, I want it to follow a different container. This is included on Lottie Interactivity as they show here: Lottie scroll relative to container (https://lottiefiles.com/interactivity)

Describe the solution you'd like
The solution would be to add this param to the function.
Describe alternatives you've considered
Can't find any other alternative since I can't seem to change the container that the function is reading.
Additional context
Example shown on lottie Interactivity page:
<script> LottieInteractivity.create({ mode: "scroll", player: "#secondLottie", container: "#MyContainerId", actions: [ { visibility: [0,1], type: "seek", frames: [0, 301] } ] }); </script>

@Gamote Gamote self-assigned this Jan 17, 2022
@Gamote Gamote added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Jan 17, 2022
@davidstellini
Copy link

Bumping this up - I got blocked on this and have no idea what I can do to go around it, trying to figure out some hack

@davidstellini
Copy link

davidstellini commented Feb 17, 2022

For anyone else struggling with this - here was my hack / workaround after looking into the source code.

  const animation = useLottieInteractivity({
    mode: 'scroll',
    lottieObj: {
      ...lottieObj,
      animationContainerRef: followRef,
    },

@clucasalcantara
Copy link

Hi @davidstellini ! Could you pls share your code? Struggling to make that work too :(

@Gamote Gamote removed their assignment Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants