Jump to content
GreenSock

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

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

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

Sounds like maybe you just forgot to load the ScrollToPlugin file? If not, I'd echo Jonathan's request for a codepen demo so we can poke around and see what's going on. 

  • Like 2
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.
×