Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
kkim

ScrollTrigger with Pixi?

Recommended Posts

Hello GSAP,

 

I am wondering if ScollTrigger is usable with Pixi?  I am creating a storytelling site where element movements are dependent on scroll triggers. I'm aware that browser scrollbar is needed for ScrollTrigger but a fullscreen Pixi canvas doesnt have scrollbars. Maybe I am taking the wrong approach here?  Taking any help or suggestions.

 

Here are a couple of examples.

https://zumi.gucci.com/

https://go.pioneer.com/cornrevolution

 

Thanks, much appreciated.

Link to post
Share on other sites

Hey kkim and welcome to the GreenSock forums.

 

ScrollTrigger works great with Pixi (and all other Canvas and WebGL libraries)! Most likely what you want to do is make some fake content/height so that the page scrolls. For example you could do body { height: 300vh; }. This will make your webpage scroll. Once it scrolls, ScrollTrigger can use the scroll position to do what you need it to do :) To keep the Pixi canvas in place, give it position: fixed and make sure its width and height take up the full screen. Make sense?

  • Like 3
Link to post
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.

×