# All scroll scene animations play when the first section comes into view

**URL:** <https://forum.pinegrow.com/t/all-scroll-scene-animations-play-when-the-first-section-comes-into-view/8273>\
**Category:** Pinegrow Interactions Add-on\
**Created:** [August 1, 2023, 9:15am UTC](https://forum.pinegrow.com/t/all-scroll-scene-animations-play-when-the-first-section-comes-into-view/8273 "2023-08-01T09:15:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjozsi](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jjozsi](https://forum.pinegrow.com/u/jjozsi)\
**Post date:** [August 1, 2023, 9:15am UTC](https://forum.pinegrow.com/t/all-scroll-scene-animations-play-when-the-first-section-comes-into-view/8273/1 "2023-08-01T09:15:38Z")

</div>

I applied custom navigation to sections on the home page of [https://linencare.ie/preview/](https://linencare.ie/preview/) and it works mostly ok.  
Each section under the hero section should slide in as the middle of the section reaches the bottom of the viewport.  
What’s happening instead: If I scroll the page immediately after the page loaded all sections animate as soon as the first section triggers the animation.  
If I wait a few seconds before start scrolling after page load, animation seem to work as expected, animating one by one as it comes to view.  
Error:  
 ![error](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/4/4c77a0159d821f129fa4b9bbf66425e60c324f65.gif)

Any idea why is this happening and how can I prevent it?

---

<div class="post-metadata">

**Author:** ![Riccarcharias](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/riccarcharias/32/4051_2.png) [@Riccarcharias](https://forum.pinegrow.com/u/Riccarcharias)\
**Post date:** [August 7, 2023, 5:36am UTC](https://forum.pinegrow.com/t/all-scroll-scene-animations-play-when-the-first-section-comes-into-view/8273/2 "2023-08-07T05:36:26Z")

</div>

Can you show screenshots of your PG Interaction settings?

---

<div class="post-metadata">

**Author:** ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)\
**Post date:** [August 7, 2023, 7:27am UTC](https://forum.pinegrow.com/t/all-scroll-scene-animations-play-when-the-first-section-comes-into-view/8273/3 "2023-08-07T07:27:20Z")

</div>

@jjozsi after investigation, it appears this happens when the scroll happens while the page is still being loaded.

One workaround is to load pgia.js manually on the page load and calling `ScrollTrigger.refresh()` afterwards:

```auto
<script>
            window.addEventListener("load", (event) => {
                var script = document.createElement('script');
script.src = "https://linencare.ie/preview/site/templates/pgia/lib/pgia.js";
document.head.appendChild(script);
script.onload = function() {
    pgia.scrollSceneManager.init();
    ScrollTrigger.refresh();
};           
});
</script>

```

Remove the current pgia.js script include and add the above code at the end of the body element.

In my experiemnts this helps prevent the issue, but note that calling ScrollTrigger.refresh() causes the page to jump up to the top.

---

<div class="post-metadata">

**Author:** ![jjozsi](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jjozsi](https://forum.pinegrow.com/u/jjozsi)\
**Post date:** [August 8, 2023, 3:48pm UTC](https://forum.pinegrow.com/t/all-scroll-scene-animations-play-when-the-first-section-comes-into-view/8273/4 "2023-08-08T15:48:21Z")

</div>

@matjaz Thank you for checking it and for the workaround. That was my suspicion too, I still don’t understand though why the animation works but not the way I expect it.  
The production site will be fully cached, that will drastically improve load time. If the issue persist I’ll implement your workaround.

---

<div class="post-metadata">

**Author:** ![jjozsi](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jjozsi](https://forum.pinegrow.com/u/jjozsi)\
**Post date:** [August 8, 2023, 3:51pm UTC](https://forum.pinegrow.com/t/all-scroll-scene-animations-play-when-the-first-section-comes-into-view/8273/5 "2023-08-08T15:51:36Z")

</div>

@Riccarcharias Sure, you can see everything here (apart from the custom animation).

 ![Screenshot 2023-08-08 at 16.50.07](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/d/d0f3be7ed958f221efad767dd1e02105d8a03cdd.png)
