Share Posted January 6 I am trying to have an intro section fade out using scrub as you scroll down the page (the viewport height) to reveal the next section under it. At the moment it is not pinning and the scrub does not work, where am I going wrong? See the Pen yLqVvGp by garethworld (@garethworld) on CodePen Link to comment Share on other sites More sharing options...
Solution Solution Share Posted January 6 Hello Gareth, 1) If you want to specify things on the ScrollTrigger attached to a tween, you should be using it as an object and have all the vars relevant to the ScrollTrigger inside that object gsap.to("#intro", { scrollTrigger: { trigger: "#content", start: "top top", end: screenH, scrub: 1, pin: true, }, opacity: 0, }); 2) Currently you don't have an element with the id of content in your HTML - because the element that you likely meant there has an # in it <div id="#content"> <-- bad <div id="content"> <-- better 1 Link to comment Share on other sites More sharing options...
Author Share Posted January 6 Ah thank you!, I have updated and it's working great. Stupid typo! <div id="#content"> <-- 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now