Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Anchor tag not working with scroll trigger in my project

Recommended Posts

Hello Gsap community...I am a newbie with using gsap....I was working on a project in which I am using scroll trigger to display the website horizontally... The problem is that the anchor tags in my home page are not working... I want the anchor tags to scroll to specific divs(having their own ID)  on click....I am also setting the width of the section divs using percentages as well as pixels..... I have provided a demo for reference...any help will be appreciated



See the Pen bGBEKBQ by light1716 (@light1716) on CodePen

Link to comment
Share on other sites


Hey @Saisarvesh Naik - welcome to the forums.


The tags are not working as you'd expect because you are not natively scrolling horizontally but only faking it when scrolling vertically, thus you'd have to take care of that functionality yourself. There's a demo on the ScrollTrigger demoes page that shows an example of how to do that with the help of GSAP's scrollTo-Plugin


See the Pen bGexQpq by GreenSock (@GreenSock) on CodePen




Also, if you search the forums, you will find quite a few threads with a similar topic, which might be helpful for you.





Hope this helps.



  • Like 3
Link to comment
Share on other sites

Hi @akapowl  Thank you so much for the reply...Ill check the solution posted by you.

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.