Jump to content
Search Community

ScrollToPlugin with link at the top

Pradeep PI test
Moderator Tag

Recommended Posts

Hey there, @Pradeep PI

 

Locomotive-scroll does not make use of native scroll behaviour and changes things fundamentaly when it comes to that. Thus it won't work with GSAP's ScrollTo-Plugin but instead has a scrollTo method of its own, which you can find more info on in their docs.

 

https://github.com/locomotivemtl/locomotive-scroll

 

As it is not a GSAP product, support for locomotive-scroll is not actually offered in these forums.

 

There is a GSAPy smoothScroll() function with ScrollTrigger too though, if that's something you might want to consider instead of locomotive-scroll. You can find an example of that in the .scrollerProxy() documentation.

 

Happy scrolling :) 

 

  • Like 2
Link to comment
Share on other sites

1 hour ago, akapowl said:

Hey there, @Pradeep PI

 

Locomotive scroll does not make use of native scroll behaviour and changes things fundamentaly when it comes to that.

Thus it won't work with GSAP's ScrollTo-Plugin but instead has scrollTo-method of its own, which you can find more info on in their docs.

 

https://github.com/locomotivemtl/locomotive-scroll

 

As it is not a GSAP product, support for locomotive-scroll is not actually offered in these forums.

 

There is a GSAPy ScrollTrigger smoothScroll() function too, though, if that's something you might want to consider instead.

You can find an example of that in the .scrollerProxy() documentation.

 

Happy scrolling :) 

 

 

Link to comment
Share on other sites

Quote

can u pls check the below script has any error or issue

 

Yes, as I mentioned, GSAP's ScrollTo-Plugin simply does not work with locomotive-scroll, so you can not use it when you use locomotive-scroll. Also you are trying to make use of jQuery syntax but are not loading jQuery in the first place.

 

Here is a solution without jQuery using locomotive-scroll's own scrollTo method

 

See the Pen 7fad2da08a4628a44511bfb7c79da891 by akapowl (@akapowl) on CodePen

  • Like 3
Link to comment
Share on other sites

59 minutes ago, akapowl said:

 

Yes, as I mentioned, GSAP's ScrollTo-Plugin simply does not work with locomotive-scroll, so you can not use it when you use locomotive-scroll. Also you are trying to make use of jQuery syntax but are not loading jQuery in the first place.

 

Here is a solution without jQuery using locomotive-scroll's own scrollTo method

 

 

 

hi @akapowl bro

thank you so much.. It works well

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