Jump to content
Search Community

ScrollSmoother: Error `Uncaught TypeError: v.resetTo is not a function` when using data-lag

coderesolution test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hello,

 

I am using ScrollSmoother, and the scroll behaviour, speed effect, etc. is all working fine.

The issue arises when I use the lag effect, which results in the following error:

vendors.js?ver=514311651744774:9 Uncaught TypeError: v.resetTo is not a function
    at Object.onUpdate (vendors.js?ver=514311651744774:9:4336)
    at Object.c [as onRefresh] (vendors.js?ver=514311651744774:9:3496)
    at vendors.js?ver=514311651744774:9:2381
    at Array.forEach (<anonymous>)
    at T (vendors.js?ver=514311651744774:9:2169)
    at vendors.js?ver=514311651744774:9:25389
    at Array.map (<anonymous>)
    at Dt (vendors.js?ver=514311651744774:9:25365)
    at Xt (vendors.js?ver=514311651744774:9:26025)

 

I am registering the plugins, initializing smoother with effects set to true.

 

/**
* GSAP
*/
/* Register plugins */
gsap.registerPlugin( ScrollTrigger, ScrollSmoother );

/* Smooth scroll */
let smoother = ScrollSmoother.create( {
	wrapper: '[data-scroll-wrapper]',
	content: '[data-scroll-content]',
	effects: true
} );

smoother.effects( '.box', {
	lag: ( i ) => i * 0.5
} );

 

However, the lag that is applied to the `.box` elements is what causes the error. I have also tried setting it within the DOM, which results in the same:

<div class="box box1" data-lag="1.5"></div>
<div class="box box2" data-lag="1"></div>
<div class="box box3" data-lag="0.5"></div>

Please can anybody advise?

 

Thank you!

Link to comment
Share on other sites

Hi @coderesolution :)

 

Welcome to the forum and thanks for being a Club member. We appreciate it.

 

Could you put that into a minimal demo for us please? We'd be happy to take look and get you pointed in the right direction.

 

You can also double check that you're using the latest versions of GSAP and the plugins.

 

Happy tweening and welcome aboard. 

:)

 

  • Like 1
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...