Jump to content
Search Community

Problem of photo fade out with transform

CalvinKwan test
Moderator Tag

Recommended Posts

The images crashed after i scrolling the page.
 
the code is below:
 
 
let tl = gsap.timeline({ repeat: -1, repeatDelay: 1 });
 
  useEffect(() => {
    tl.to(slideRef1.current, {
      duration: 1,
      ease: "linear",
      opacity: 1,
      delay: 0,
      x: -20,
    })
      .to(slideRef1.current, {
        duration: 3,
        ease: "linear",
        delay: 0,
        x: -100,
      })
      .to(slideRef1.current, {
        duration: 1,
        ease: "linear",
        opacity: 0,
        delay: 0,
        x: -120,
        display: "none",
        zIndex: -1,
      })
      .to(slideRef2.current, {
        duration: 1,
        ease: "linear",
        opacity: 1,
        delay: 0,
        x: -20,
      })
      .to(slideRef2.current, {
        duration: 3,
        ease: "linear",
        delay: 0,
        x: -100,
      })
      .to(slideRef2.current, {
        duration: 1,
        ease: "linear",
        opacity: 0,
        delay: 0,
        x: -120,
        display: "none",
        zIndex: -1,
      })
 
 
 
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...