Jump to content
Search Community

How to correctly implement ScrollTrigger normalize scroll

stefanobartoletti test
Moderator Tag

Recommended Posts

Given my following animation
 

import { gsap } from 'gsap';

import { ScrollTrigger } from 'gsap/ScrollTrigger';

 

gsap.registerPlugin(ScrollTrigger);

 

 

const icons = document.querySelectorAll('.icon');

 

 
icons.forEach(icon => {
gsap.to(icon, {
rotate: 180,
ease: 'linear',
duration: 10,
scrollTrigger: {
trigger: icon.parentNode,
start: 'top 100%',
end: 'bottom 0%',
scrub: 5,
}
});
});

 

I need to implement the normalizeScroll function on ScrollTrigger, but it is not very clear to me how to do it when using Scrolltrigger inside Gsap like in my example.

Can somebody help me?

Link to comment
Share on other sites

Hi,

 

Normalize scroll acts on tha way the scroll works, Soto speak. From the ScrollTrigger docs :

 

Forces scrolling to be done on the JavaScript thread, ensuring screen updates are synchronized and the address bar doesn't show/hide on [most] mobile devices.

 

As you can see it doesn't act on the way ScrollTrigger works directly but on the scroll, which obviously has an effect on how ScrollTrigger instances behave especially in devices.

 

Hopefully this helps

Happy Tweening!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...