# Play once when scrolled into view

**URL:** <https://forum.lottiefiles.com/t/play-once-when-scrolled-into-view/5349>\
**Category:** Lottie in Web\
**Created:** [February 13, 2024, 8:24pm UTC](https://forum.lottiefiles.com/t/play-once-when-scrolled-into-view/5349 "2024-02-13T20:24:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam5](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.lottiefiles.com/sam5/32/3405_2.png) [@Sam5](https://forum.lottiefiles.com/u/Sam5)\
**Post date:** [February 13, 2024, 8:24pm UTC](https://forum.lottiefiles.com/t/play-once-when-scrolled-into-view/5349/1 "2024-02-13T20:24:00Z")

</div>

I have an animation that I only want to play when scrolled into view and I don’t want it to reset or play again unless the page is reloaded.

I’m currently following this method: [https://help.lottiefiles.com/hc/en-us/articles/5426133805337-Play-animation-when-visible](https://help.lottiefiles.com/hc/en-us/articles/5426133805337-Play-animation-when-visible)

When I use this, my animation plays when scrolled into view however any movement of scrolling will re-trigger the animation to start again. Even on the above example, the animation triggers on any scroll movements.

Has anyone found a way to stop this happening. Thanks.

---

<div class="post-metadata">

**Author:** ![haleeza](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.lottiefiles.com/haleeza/32/4969_2.png) [@haleeza](https://forum.lottiefiles.com/u/haleeza)\
**Post date:** [February 14, 2024, 7:18am UTC](https://forum.lottiefiles.com/t/play-once-when-scrolled-into-view/5349/2 "2024-02-14T07:18:14Z")

</div>

Hey @Sam5

You can change the `type: "play"` to `type: "playOnce"`  
Check out this doc for more information: [Animation Modes - Lottie-Interactivity](https://docs.lottiefiles.com/lottie-interactivity/animation-modes#animate-when-visible-and-play-once)
