Jump to content
Search Community

Animating height + ScrollTrigger + anchor links

zofia test
Moderator Tag

Recommended Posts

Hi,

in my project I use many different "dividers" which change their height when they enter and leave the viewport. I use SvrollTrigger for that but I can't force it to do what I want :). 


Everything has worked fine for me so far but recently I decided to add a table of contents to one of my pages. I use anchor links which should jump to their respective sections.  This is where the problem starts - the navigation does not lead me to the right sections. So, for example, if I click in the navigation on section 3 - it takes me to section 4 or somewhere between sections. 

 

For better understanding, the general concept of my website is here: https://gracious-brown-97593d.netlify.app


Maybe someone could help me find a solution? I made a minimal demo so you can look at it.

 

Thank you!

See the Pen xxrmpQE by zofiaifoz (@zofiaifoz) on CodePen

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