Jump to content
Search Community

ScrollTrigger Pause Timeline on "onEnterBack"

Joshua Harmon test
Moderator Tag

Recommended Posts

Hi there @Joshua Harmon

It may be that you're just killing the timeline and not the scrollTrigger - If you use a more current version of GSAP tl.kill() will also kill the associated scrollTrigger.

You have a lot of absolutely positioned elements though so if you kill the scrollTrigger you're also going to lose the ability to 'scroll' through the content.

You might have to kill the scrollTrigger and then set some styles so your page is actually navigable.

Updated GSAP version - killing the timeline and scrollTrigger

See the Pen wvrpoxR?editors=0010 by GreenSock (@GreenSock) on CodePen



 

This may also be of help.

Good luck!

Link to comment
Share on other sites

43 minutes ago, Cassie said:

Hi there @Joshua Harmon

It may be that you're just killing the timeline and not the scrollTrigger - If you use a more current version of GSAP tl.kill() will also kill the associated scrollTrigger.

You have a lot of absolutely positioned elements though so if you kill the scrollTrigger you're also going to lose the ability to 'scroll' through the content.

You might have to kill the scrollTrigger and then set some styles so your page is actually navigable.

Updated GSAP version - killing the timeline and scrollTrigger

 


 

 

 

This may also be of help.

Good luck!

Actually that's where I got stuck I can no longer scroll to section 2.

Link to comment
Share on other sites

Yeah - that's more of a styling issue. GSAP is scrolling through a timeline, the page itself isn't actually 'scrolling'.

When you kill the timeline, you'll need to write some code to position each section relatively and make sure they're visible. Right now without scrollTrigger enabled you can't see the other sections.

Demo without any JS at all - no ability to scroll through.

See the Pen VwMyPxg?editors=0010 by GreenSock (@GreenSock) on CodePen

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