Jump to content
Search Community

scrollTrigger: progress bar become full and empty in different duration

Mo5 test
Moderator Tag

Go to solution Solved by awazigh,

Recommended Posts

  • Mo5 changed the title to scrollTrigger: progress bar become full and empty in different duration
  • Solution

Hey Mo!

Something like this?

const tlBar = gsap.timeline({paused: true})

tlBar.from('.two span',{
    scaleX:0,
    transformOrigin: "left center", 
})

ScrollTrigger.create({
  trigger:'.two',
  start:'center center',
  markers:true,
  onEnter: () => {
    tlBar.play().duration(15)
  },
  onLeaveBack: () => {
    tlBar.reverse().duration(5)
  }
});

 

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