Jump to content
Search Community

Angular 8 ScrollToPlugin

StormCode test
Moderator Tag

Recommended Posts

I was just wondering if anyone has successfully got ScrollToPlugin (v3.0.5) to work with Angular 8. I have it working to a certain degree but it does not respect the vars in the tween.

      gasp.to(window,
        {
          delay: 0,
          duration: 10,
          ease: 'back',
          scrollTo: 978
        }

All that happens is a smoothScroll to 978. The 'ease' is ignored and strangely  the 'delay' is 10secs which is what the duration is set to!

 

My component contains:-

 

import { gsap } from 'gsap/all';

import ScrollToPlugin from 'gsap/ScrollToPlugin';

 

  constructor() {

    gsap.registerPlugin(ScrollToPlugin);
  }

  ngOnInit() {
    const plugins = [ScrollToPlugin];

}

 

Thanks a lot if anyone can help!!

 

 

 

Link to comment
Share on other sites

Welcome to the forums, @StormCode. I'm curious - do you have a reduced test case we can look at? Maybe in codepen or stackblitz.com? As for the ease, keep in mind that the browser won't allow you to scroll something beyond its max, so I wonder if that's why you think the "back" ease isn't working correctly. GSAP may very well be setting the scroll property correctly, but the browser may simply ignore values beyond a certain point. 

 

I'm sure a reduced test case will clear everything up and allow us to offer a solid answer. The whole 10-second delay thing has me very curious.

 

Happy tweening!

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