Share Posted April 10, 2017 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 More sharing options...
Share Posted April 10, 2017 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! 3 Link to comment Share on other sites More sharing options...
Share Posted April 10, 2017 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. 2 Link to comment Share on other sites More sharing options...
Author Share Posted June 28, 2018 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. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now