Jump to content
Search Community

Scroll trigger is not working when body overflow is hidden

deepdas test
Moderator Tag

Recommended Posts

Hi @deepdas and welcome to the GSAP forums!

 

Maybe the Observer Plugin is what you're looking for:

https://gsap.com/docs/v3/Plugins/Observer/

 

It has to be expected that ScrollTrigger is not going to do much in this case. ScrollTrigger doesn't watch the specific wheel/touch event but the scroll position in order to update the progress of a Tween/Timeline according to the start and end points you feed to it.

 

Observer on the other hand seems a perfect fit if you remove the overflow of the body tag and want to trigger animations based on specific events.

 

Hopefully this helps.

Happy Tweening!

Link to comment
Share on other sites

Hi @Rodrigo

 

Thank you for the suggestion.
 

The overflow hidden is required here as no scroll bar is needed on the page.

 

I am new to GSAP so can you please provide us an example for the implementation of  the observer plugin?

 

It will be really helpful for me.

 

Thanks in Advance.

Link to comment
Share on other sites

Hi, 

if you remove this code 
 

scrollTrigger: {
        trigger: '.wrapper',
        start: 'top top',
        end: "bottom top",
        scrub: 1
    } 

 

svg motionPath works fine  but i need this on mouse wheel.

When i move the mouse wheel,  the blue circle movement depends on mouse wheel and the blue ball will stop movement when i stop scrolling the mouse wheel.

After the blue ball reaches the right bottom area of the page then the blue ball starts again on the top left.

Can you please create a demo for me it will be very help full for me.

 

 

 

 

 

Thank You 

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