Jump to content
Search Community

I use scrollTrigger, and I can't see the image.

goodcontext
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

Posted

Sometimes you can see an image, sometimes you can't.

You can see it well on the code pen.

But local or github.io I can't see it. There are times when you can see it.

Even if I try this and that, it doesn't work. How can I fix this?

It often works well in chrome.
However, I think there are more times when you can't see it from the edge.

bug_report.zip

See the Pen eYeJEBv by goodcontext (@goodcontext) on CodePen.

elegantseagulls
Posted

I think your issue is that you're nesting two scroll triggers in a single timeline. You should just be able to use a gsap.from(...) for each one.

  • Like 1
  • Solution
Posted

You should probably refresh ScrollTrigger when your images have loaded.

 

window.addEventListener("load", () => {
  ScrollTrigger.refresh()
});

 

  • Like 1
Posted
1 hour ago, OSUblake said:

You should probably refresh ScrollTrigger when your images have loaded.

 

window.addEventListener("load", () => {
  ScrollTrigger.refresh()
});

 

See the Pen vYWLdvX by goodcontext (@goodcontext) on CodePen.

 

Thank you both so much.
I fixed the code and it works perfectly.
Thank you.

result_code.zip

  • Like 1

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