Jump to content
Search Community

Ease not working with ScrollTo

JoeH test
Moderator Tag

Recommended Posts

I searched for this issue but could not find any mention of it, I've checked the Docs and I seem to be doing this correctly, however the window will not scroll with an easing, it just seems to use a default one which starts very slow then suddenly accelerates and stops suddenly.

 

Here is my code:

 

var thumbs = document.getElementsByClassName('col');
Array.prototype.forEach.call(thumbs, function(t) {
  t.addEventListener('click', function() {
    gsap.to(window, 0.6, {scrollTo: '#info-section', ease:"power2.inOut"});
  })
});

 

I was thinking that maybe I hadn't included the EasePack or something so I tried to just animate a random element on the page to a Y value, and this worked with the easing I had declared it to use. Which makes me wonder if it is a problem with scrollTo?

 

 

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