GSAP ScrollTrigger.normalizeScroll()

I’m currently working on a fairly simple animation, a pinned section with horizontal scrolling. Everything works perfectly except for when it runs on mobile devices or safari aka the new internet explorer :stuck_out_tongue:

I was looking around and found that normalizeScroll() could be a solution or at least part of one → Docs - GreenSock

I tried to access bricksforgePanel and bricksforgeData but the timeline object is empty, I’m pretty sure I’m just looking in the wrong place.

Then I tried to put on my detective cap and see if maybe it was already implemented by default. I did find some references to it but if I’m not mistaken, those are for the gsap scrollsmoother.

Could you give me a hint on how to access the timeline so I can see if normalizeScroll actually fixes anything? :slight_smile:

Hey @manc :slight_smile:

The timelines are saved in the “old” location. You find them under brfPanel.timelines. Will update all related data to the new bricksforgeData location in future versions, but everything with backwards compatibility.

1 Like

aaah gotcha thanks :slight_smile: Turns out I didn’t even need to access them to normalize the scroll haha. Now it’s weirdly smoother in safari but choppier in chrome, I’ll keep investigating and hopefully I can make it smooth everywhere.

Hello, How can I activate normalize Scroll please? did you add an event during DOMCONTENTLOADED on the bricks panel?

I didn’t end up using it, design changed.

I did try it again just now and I suspect I didn’t even get it working back then, something was smoother for me though so I’m not sure if it had an effect or I had done something else. Kinda confusing myself a bit with this one rn haha.

But yes, what I did was create an event once the dom is loaded and just added ScrollTrigger.normalizeScroll(true); in the js tab.

The reason I believe it might never have actually worked, is that logging the ScrollTrigger in the console, throws a warning to register the plugin. If I do that, it seems to not register all the others, included by default, anymore. If however I log ScrollTrigger.normalizeScroll in the console, it does return the gsap function so it does find it.

Maybe just give it a shot and lemme know if it did anything :slight_smile:

I did, it actually seemed to make things worse with the scroll so I got rid of it.

The issue was bc of the address bar on mobile and when you manually called the ST.refresh(); function it causes a jitter effect cuz it has to recalculate the screen. I also had a slider that has adaptive height and that’s why I needed the refresh function

Anyways, just changed my design to not use ST after the adaptive height and then changed it to only call that function on desktop not mobile