Jump to content
Search Community

Navigation through pin stacking cards

vlanesvit test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

Hello,
 

I'm having some trouble navigating the pinned cards block.
 

In the menu on the left there are anchor links that, when clicked, should scroll to their block. Also, during normal scrolling, links should be marked with an active class when the block becomes visible.
 

Now, when clicked, the link scrolls to the top of the parent block, as far as I understand, because the cards are on top of each other.
 

What is the problem? How can I pin the scroll to the desired block?
 

I used these URLs to implement cards on top of each other and for navigation:
 

https://greensock.com/forums/topic/33597-stacking-cards-overlap/

And

https://gsap.com/community/forums/topic/35776-click-to-navigate-to-a-section-using-gsap/

See the Pen gOExGzZ by Vlanesvit (@Vlanesvit) on CodePen

Link to comment
Share on other sites

1 hour ago, mvaneijgen said:

Что вы можете сделать, так это подсчитать, сколько занимает каждый элемент, а затем прокрутить до этого значения, умноженного на индекс нажатой привязки. Надеюсь, это поможет и счастливого подросткового периода! 

 

 

 

Thank you very much for your help 😃
I'll also try to implement switching the active class when scrolling the card

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