Jump to content
Search Community

rotation and zindex is not working

omkar test
Moderator Tag

Recommended Posts

Hi,

 

The toggleActions config string goes in the scrollTrigger config object, not in the tween config object:

// Won't work
parallaxt2.to('#Layer_1', {
  rotationX: 90,
  toggleAction: 'play none none reverse',
  transformOrigin: "bottom 50%"
})

// Will Work
let parallaxt2 = gsap.timeline({
  ease: 'none',
  scrollTrigger: {
    trigger: '#topaddedsectionshoeimg',
    start: 'center center',
    end: 'bottom center',
    scrub: true,
    toggleAction: 'play none none reverse',
  }
});

Also the reason your codepen wasn't working is because you have the link for the GSAP Core file but not for ScrollTrigger. Is better to add those links in the codepen's JS configuration section:

TCoGZ2N.png

lHPmlze.png

 

Finally I created a fork of your codepen that seems to work the way you intend:

See the Pen WNaEdRb by GreenSock (@GreenSock) on CodePen

 

Hopefully this helps.

Happy Tweening!

Link to comment
Share on other sites

Sometime z-Index is delayed because of that blue backgroud is come of img for some millisecond and while resize page marker(start and end points) shifts little bit because of that animation appers bit early than expected 

Link to comment
Share on other sites

Hi,

 

As I mentioned before I'm having a hard time following what you're trying to do. Please be specific about what you're trying to do, what the issue is and provide a minimal demo. Without a demo and vague description, there is almost nothing we can do to help you.

 

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