Jump to content
Search Community

gsap.min.js:10 Uncaught TypeError: Failed to execute 'scrollTo' on 'Element': parameter 1 ('options') is not an object.

SumitJadhav
Moderator Tag

Recommended Posts

Posted

I am using 
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.12.1/TweenMax.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/plugins/ScrollToPlugin.min.js"></script>
for smooth scrolling which was working fine initially. But when I use <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js"></script>    for svg animation it gives me error as "gsap.min.js:10 Uncaught TypeError: Failed to execute 'scrollTo' on 'Element': parameter 1 ('options') is not an object.".

Any solution for same?

Posted

Hey Sumit and welcome to the GreenSock forums.

 

It's not exactly clear what the issue is given you didn't provide a complete demo. My guess is that you're trying to use an old version of the ScrollToPlugin with the new GSAP 3 core. That won't work. If you're going to use the GSAP 3 core then you also need to use the GSAP 3 version of the plugins. Try this:

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/ScrollToPlugin.min.js"></script>

If that doesn't fix the issue, please create a complete and minimal demo on CodePen as this thread covers:

 

  • Like 1
Posted
13 minutes ago, ZachSaucier said:

Hey Sumit and welcome to the GreenSock forums.

 

It's not exactly clear what the issue is given you didn't provide a complete demo. My guess is that you're trying to use an old version of the ScrollToPlugin with the new GSAP 3 core. That won't work. If you're going to use the GSAP 3 core then you also need to use the GSAP 3 version of the plugins. Try this:


<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/ScrollToPlugin.min.js"></script>

If that doesn't fix the issue, please create a complete and minimal demo on CodePen as this thread covers:

 

Hi ZachSaucier,

thank you so much for quick response. It works now by updating version.
Thanks a Ton... !!!!

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