Akarsh Posted June 15, 2020 Share Posted June 15, 2020 Hi guys, I am new to GSAP. I am stuck at ScrollTrigger. I tried using ScrollTrigger for t2 and t3. But it is not working and markers are also not showing up. I tried both the ways for the markers also i.e. using true and {startColor: "green" , endColor: "red" , font-size: "12px"}. All the animations are getting activated on page load, I want them to load them when we scroll through that section. I have created timelines separately for each section. I am using https://cdnjs.com/libraries/gsap/3.3.2 for cdns. Link to comment Share on other sites More sharing options...
GreenSock Posted June 15, 2020 Share Posted June 15, 2020 Sounds like you forgot to load ScrollTrigger. Got a demo we could look at? It is just really hard to troubleshoot blind. We’d love to help. Link to comment Share on other sites More sharing options...
Akarsh Posted June 15, 2020 Author Share Posted June 15, 2020 I have used the following code to load ScrollTrigger. <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.3.3/gsap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.3.3/ScrollTrigger.min.js"></script> and gsap.registerPlugin(ScrollTrigger); in my script file Link to comment Share on other sites More sharing options...
GreenSock Posted June 15, 2020 Share Posted June 15, 2020 We cannot help if we don’t have a reduced test case to look at. I am sure it is something simple. Can you provide one please? Link to comment Share on other sites More sharing options...
GreenSock Posted June 15, 2020 Share Posted June 15, 2020 Make sure you put your scripts at the end of the body tag so the DOM exists before you try manipulating it. Link to comment Share on other sites More sharing options...
Akarsh Posted June 15, 2020 Author Share Posted June 15, 2020 Done that from the beginning. I have put console.log(timelines) and is attaching them here. Maybe that can help you figure out the problem. Link to comment Share on other sites More sharing options...
Akarsh Posted June 15, 2020 Author Share Posted June 15, 2020 Here is another one. const t3 = gsap.timeline({ ease: 'Power4.easeOut', ScrollTrigger : { trigger: '.icon-placement', // markers: {startColor: "green", endColor: "red", fontSize: "12px"}, marker:true, start: "top centre", scrub:true, } }); console.log(t3); t3.from('.featureinfo' , { opacity:0 , x:-60 } , "+=0.40" ) t3.from('.featurepara' , { opacity:0 , x:60}) t3.from('.anim3l' , { opacity:0 , x:-50} , "+=0.10") t3.from('.anim3r' , { opacity:0 , x:50} , "-=0.10") t3.from('.phone-mid' , { opacity:0 , y:40}) Link to comment Share on other sites More sharing options...
Akarsh Posted June 15, 2020 Author Share Posted June 15, 2020 Any idea about why markers are also not showing up ? Link to comment Share on other sites More sharing options...
oligsap Posted June 15, 2020 Share Posted June 15, 2020 your markers are not showing up because you are using "marker" instead of "markers". 2 Link to comment Share on other sites More sharing options...
Akarsh Posted June 15, 2020 Author Share Posted June 15, 2020 Thanks @oligsap, got that working. scrollTrigger also worked by using ScrollTrigger.create() Link to comment Share on other sites More sharing options...
Brittany@Decisely Posted June 15, 2020 Share Posted June 15, 2020 I was having this problem yesterday. It seemed to have been an issue with the gsap.min.js file. I pulled the js from here: https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/gsap-latest-beta.min.js and it started working. Link to comment Share on other sites More sharing options...
Akarsh Posted June 16, 2020 Author Share Posted June 16, 2020 @Brittany@Decisely Thanks, will try this also. Link to comment Share on other sites More sharing options...
Bosung Posted December 19, 2021 Share Posted December 19, 2021 i think, this problem is due to upper case. gsap.to( element, { scrollTrigger : { //ScrollTrigger -> scrollTrigger ... }, }); 3 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