Jump to content
Search Community

Pinned elements jumps on trigger

nurlan test
Moderator Tag

Recommended Posts

Hello there! I'm new at GSAP and ScrollTrigger animations. So i have issue: when 2 elements starts to pin, they just jump. You can see it only when using mouse. Laptop gesture scroll works smooth.

my code:

gsap.timeline({
        scrollTrigger: {
            trigger: '.benefits__title',
            start: `top top`,
            end: '+=5000',
            pin: '.benefits__title',
            pinSpacing: false,
        }
    })
 
    gsap.timeline({
            scrollTrigger: {
                trigger: '.benefits__slider',
                start: '25% center',
                end: '+=5000',
                pin: true,
            },
        })
        .to('.benefits__slider-item--1', {
            opacity: 0,
            ease: 'slow',
        })
        .from('.benefits__slider-item--2', {
            opacity: 0,
            ease: 'slow',
        })
        .to('.benefits__slider-item--2', {
            opacity: 0,
            ease: 'slow'
        })
        .from('.benefits__slider-item--3', {
            opacity: 0,
            ease: 'slow',
        })
        .to('.benefits__slider-item--3', {
            opacity: 0,
            ease: 'slow'
        })
        .from('.benefits__slider-item--4', {
            opacity: 0,
            ease: 'slow',
        })
        .to('.benefits__slider-item--4', {
            opacity: 0,
            ease: 'slow'
        })
        .from('.benefits__slider-item--5', {
            opacity: 0,
            ease: 'slow',
        })

 

https://web.codeunion.kz/ (4th section)

 

Thanks to any help! And sorry for my bad english)

Снимок экрана 2021-04-04 003617.png

Link to comment
Share on other sites

Have you tried anticipatePin?

 

anticipatePin

Number - If you pin large sections/panels you may notice what looks like a slight delay in pinning when you scroll quickly. That's caused by the fact that most modern browsers handle scroll repaints on a separate thread, so at the moment of pinning the browser may have already painted the pre-pinned content, making it visible for perhaps 1/60th of a second. The only way to counteract that is to have ScrollTrigger monitor the scroll velocity and anticipate the pin, applying it slightly early to avoid that flash of unpinned content. A value of anticipatePin: 1 is typically fine, but you can reduce or increase that number to control how early it does the pinning. In many cases, however, you don't need any anticipatePin (the default is 0).

 

https://greensock.com/docs/v3/Plugins/ScrollTrigger

  • Like 2
Link to comment
Share on other sites

3 hours ago, PointC said:

Have you tried anticipatePin?

 

anticipatePin

Number - If you pin large sections/panels you may notice what looks like a slight delay in pinning when you scroll quickly. That's caused by the fact that most modern browsers handle scroll repaints on a separate thread, so at the moment of pinning the browser may have already painted the pre-pinned content, making it visible for perhaps 1/60th of a second. The only way to counteract that is to have ScrollTrigger monitor the scroll velocity and anticipate the pin, applying it slightly early to avoid that flash of unpinned content. A value of anticipatePin: 1 is typically fine, but you can reduce or increase that number to control how early it does the pinning. In many cases, however, you don't need any anticipatePin (the default is 0).

 

https://greensock.com/docs/v3/Plugins/ScrollTrigger

Yes i do. It did not give any results

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...