Jump to content
Search Community

tslevack

Members
  • Posts

    5
  • Joined

  • Last visited

tslevack's Achievements

  1. Thank you so much for the course correction. I have the page working exactly I wanted now. I appreciate your help.
  2. I added a function to log variable just before its called. On click sets new variable and logs correctly, then timeline logs correct variable just before being called. Unfortunately, the next to() line is still loading ".Mcal" instead of ".Mfea". How is old variable loading??? so confused. LOL let activePage = ".Mdes"; let nextPage = ".Mcal"; let activeBut = ".desbut"; let nextBut = ".calbut"; let tlD2F = gsap.timeline({ paused: true, }); tlD2F.to(activePage, { zIndex: 0, opacity: 0, onComplete: function() { console.log("Current nextPage:", nextPage); } }); tlD2F.to(nextPage, { zIndex: 30, opacity: 1, marginTop: "0vh", duration:1, }, );
  3. Having an issue getting timeline to see new variable. I have timeline items that are targeted with variables, which works fine with original variable set on page load. I have onClick function that sets new variable and then plays the timeline. I even log new variable in console before play command, which shows the new variable. The timeline plays, but loads the initial variable... not the new one that has been confirmed in console. Any thoughts why the correct variable is not being used by the timeline? THANKS! <script> let activePage = ".Mdes"; let nextPage = ".Mcal"; let activeBut = ".desbut"; let nextBut = ".calbut"; let tlD2F = gsap.timeline({ paused: true, }); tlD2F.to(activePage, { zIndex: 0, opacity: 0, }); tlD2F.to(nextPage, { zIndex: 30, opacity: 1, marginTop: "0vh", duration:1, }, ); tlD2F.to(activeBut, { zIndex: 0, opacity: 0, }, 0); tlD2F.to(nextBut, { zIndex: 500, opacity: 1, }, 0); document.getElementById('D2F').onclick = function(event) { tlD2F.pause(); nextPage = ".Mfea"; nextBut = ".feabut";; console.log("nextPage:", nextPage); console.log("nextButton:", nextBut); tlD2F.play(0); }; </script>
  4. Thank you both. I will try this method.
  5. Just starting out. Trying to animate clip-path on scroll. It's working but the left side doesn't transition out.. It just jumps to end, the the right side plays fine. Can anyone see what Im missing??? thanks T
×
×
  • Create New...