romain.gr Posted November 30, 2019 Share Posted November 30, 2019 (edited) Hi, I'm struggling doing something very simple, can someone explain me what's wrong with this : $('a').on('click', function(e){ e.preventDefault(); var thisId = $(this).attr('href'); console.log(thisId); TweenMax.to(window, {duration: 2, scrollTo: thisId}); //TweenLite.to(window, {duration: 2, scrollTo: thisId}); //TweenMax.to(window, {duration: 2, scrollTo: {y: '100', offsetY: 50}}); //TweenMax.to(window, {duration: 2, scrollTo: 400}); }); I'm unable to make this work even tho it seems to be very simple to make it work, I'm following the documentation (well, I guess) : //scroll to 400 pixels down from the top gsap.to(window, {duration: 2, scrollTo: 400}); //or to scroll to the element with the ID "#someID": gsap.to(window, {duration: 2, scrollTo:"#someID"}); //or to specify which axis (x or y), use the object syntax: gsap.to(window, {duration: 2, scrollTo: {y: 400, x: 250}}); In my code, none of the commented is working + I'm using the old version of GSAP : TweenMax et ScrollToPlugin: Version 2.1.3 Thank you ////////////////////////////////////////// Well, I'm not really sure why the documentation has been totally modified for the new version of GSAP, without leaving any information about the previous versions : so for the previous version : TweenMax.to(window, 2, {scrollTo: thisId}); and for the new version : TweenMax.to(window, {duration: 2, scrollTo: thisId}); Is it possible to still have access to the documentation for the previous Versions of GSAP or it has been deleted for ever? See the Pen nqAwvWzGOYbr#section4 by romaingranai (@romaingranai) on CodePen Edited November 30, 2019 by romain.gr Found the answer to my question Link to comment Share on other sites More sharing options...
mikel Posted December 1, 2019 Share Posted December 1, 2019 Hey @romain.gr, Please use the version button: 2 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