Jump to content
Search Community

eseka

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by eseka

  1. 4 hours ago, GreenSock said:

    Indeed, it's pretty much impossible to troubleshoot without a minimal demo, but I noticed one problem for sure: 

    // bad
    let tl = new GSAP.timeline({ immediateRender: false,  });
    
    // good
    let tl = gsap.timeline();

    You should NOT have the "new" keyword there and there's no such thing as setting immediateRender on a timeline. That's only for tweens. 

     

    This also looked suspicious to me: 

    start: "top top",
    end: "bottom bottom",

    That would only work if your ".scroll-controls" element is taller than the viewport itself. Imagine that it is actually height: 100vh...that would mean that when the top hits the top (your start), the bottom would also hit the bottom at the very same time! And if it's shorter than the viewport, the end would get triggered before the start. 

     

    If you still need help, please make sure you provide a minimal demo👍

     

    Many thanks ! You're right in both.

    I was thinking that everything was played but then I realized that it was playing until certain point... so it was a concept problem about the layout and the markup + css. 

     

    Here is the demo where it works as it should

     

    See the Pen QWVzwdq by alvarindev (@alvarindev) on CodePen

     

    In my case also I had some elements above the ".scroll-controls" that after some time I hidde by using display:none. Also I'm using scrollTrigger.refresh() when I do that. 

     

    THX

     

     

    • Like 2
  2. Hello !

    After a lot of time using GSAP I don't really understand why this is happening. It is a very simple use case. 

    First I create the Master timeline that is fired by ScrollTrigger

    this.master = new GSAP.timeline({
          scrollTrigger: {
            trigger: ".scroll-controls",
            start: "top top",
            end: "bottom bottom",
            scrub: 1,
            immediateRender: false,
          },
        });

    then I add some tweens and finally I build the master timeline

     cuadro0() {
        let tl = new GSAP.timeline({ immediateRender: false,  });
    
        tl.fromTo(this.camera.position, { x: -5.9 }, { x: -4.1, z: 4.7 }).to(
          this.camera.rotation,
          {
            y: -3,
          }
        );
    
        return tl;
      }
    
    buildMaster() {
        this.master.add(this.pasillo0());
        this.master.add(this.cuadro0());
      }

    The expected behaviour is to wait to reach the ScrollTrigger section to play the timeline but the reality is that everything is played on page load...

     

    what is happening? 

     

    I tried many approach like pausing it, disabling it... but no way 😕

     

  3. Hello! Thanks for your fast reply

    I tried to replicate the error but I can't! sometimes it appears in the console and sometimes not. The thing is that I feel estrange behaviour when using a 📌 element. 

     

    I will try to reshape the code giving correct display property

     

    find attached a screenshot of the console

     2136912589_Screenshot2022-12-13at20_54_00.png.5e129f27a66947363b308bb3270c30ca.png

     

    Edit: Also a pic of the bug I got! the animation is working fine in full viewport height but when resizing I got this :( It seems that the start mark moves relatively with the size of the viewport but why? 

    image.thumb.png.ce08084f962254017d411751848f8ece.png

×
×
  • Create New...