Jump to content
Search Community

TweenMax.min.js:17 Uncaught TypeError: Failed to execute 'scrollTo' on 'Window': No function was found that matched the signature provided.

DjKarimi test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi mr admin

i run script this error :
 

$.fn.setSmoothPageScroll = function (options) {
    var ops = { time: 0.8, distance: 190 }, t = $(this), g = 'mousewheel DOMMouseScroll MozMousePixelScroll';
    ops = $.extend({}, ops, options || {});
 
    t.unbind(g).on(g, function (e) {
        var elem, v = $(this);
        if (e.srcElement) elem = $(e.srcElement);
        else if (e.target) elem = $(e.target);
        if (elem) {
            var t = $(elem).getInputType();
            if (t == 'select' || t == 'option') return;
        }
 
        e.preventDefault();
        e.stopPropagation();
        e.stopImmediatePropagation();
 
        var delta = e.wheelDelta || e.detail || e.originalEvent.wheelDelta || e.originalEvent.detail * -1;
        if (delta < 0) delta = -1; else delta = 1;
        var scrollTop = v.scrollTop(), finalScroll = scrollTop - parseInt(delta * ops.distance);
        TweenMax.to(v, ops.time, { scrollTo: { y: finalScroll, autoKill: true }, ease: Back.easeOut, autoKill: true, overwrite: 5 });
    });
 
    return this;
};
 
:(
Link to comment
Share on other sites

Hello kkarimi91

 

It will be hard to debug or see whats going on just by that code snippet alone.

  • Are you loading TweenMax.min.js before other scripts?
  • Are you also using TweenLite and not loading the GSAP ScrollToPlugin file?
  • What order are you loading TweenMax in? make sure your not calling it before you load and call TweenMax.min.js

To better help you, can you please provide a codpen demo example so we can see your code in context. And see how and in what order you might be loading your code?

 

 

Thanks! :)

  • Like 3
Link to comment
Share on other sites

  • 1 year later...
On 4/10/2017 at 8:39 PM, Jonathan said:

Hello kkarimi91

 

It will be hard to debug or see whats going on just by that code snippet alone.

  • Are you loading TweenMax.min.js before other scripts?
  • Are you also using TweenLite and not loading the GSAP ScrollToPlugin file?
  • What order are you loading TweenMax in? make sure your not calling it before you load and call TweenMax.min.js

To better help you, can you please provide a codpen demo example so we can see your code in context. And see how and in what order you might be loading your code?

 

 

 

Thanks! :)

 

Hi thank you , Must file load ''ScrollToPlugin" in file js.

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