Jump to content
GreenSock

nurlan

Anchor link and section with pin

Moderator Tag

Recommended Posts

Hello there! I'm new at Gsap animations. I have issue with anchor link. I have a link that directs to footer. But on the scroll it acts really weird. How can i fix that? For smooth scrolling i use simple scroll-behavior: smooth.

 

https://web.codeunion.kz/ (link "Контакты" on the header)

 

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',
        })

 

I have 2 sections on the way who has code like this

 

Thanks to any help! Sorry for my bad english)

Link to comment
Share on other sites

Hi nurlan,

 

Welcome to the forum, if possible please make a simplified example of the issue on codepen so we can have a look. It's very difficult to troubleshoot a live website.

 

  • Like 3
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.
×