Jump to content
Search Community

ScrollTrigger offscreen reset technique ignoring scrub

Delarge test
Moderator Tag

Recommended Posts

Hi, is it possible to get the ScrollTrigger offscreen reset technique (good demo on another post) working with scrub?

 

My code, which almost works, is:

 

const anim_supersonic_image_1 = gsap.from("#supersonic-image-1", {
  opacity:0,
 x: 80,  
 duration:1,
  ease: "back(1)",
  paused: true,
  scale: 1.1,
  perspective: 250,
  rotateX: -15,
  rotateY: 30,

})   
  
const play_anim_supersonic_image_1 = ScrollTrigger.create({
   trigger: "#supersonic-image-1",
    scrub: 1, // <---- BEING IGNORED
    start:"top 70%",
  onEnter: () => anim_supersonic_image_1.play()
});

const reset_anim_supersonic_image_1 = ScrollTrigger.create({
  trigger:'#supersonic-image-1',
  onLeaveBack: () => anim_supersonic_image_1.pause(0)
});

 

See my note about 'BEING IGNORED'?

Where am I going wrong here?

 

Many thanks!

 

Link to comment
Share on other sites

Hi @Delarge!

 

Is that possible to provide a demo from codepen please? I'm not sure without testing, but your example seems to be something like the URL you propose... I have tested some part of your code by copy/paste him in the codepen of the DEMO, but is working good for me.

 

ScrollTrigger is register too?

gsap.registerPlugin(ScrollTrigger);

 

 

Best regards!
Sam

 

 

 

Edited by Sam Tremblay
Edit post after real test
  • Like 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...