Jump to content
Search Community

Renson Ralph Bitara

Members
  • Posts

    3
  • Joined

  • Last visited

Renson Ralph Bitara's Achievements

  1. Case solved Cause: Incorrect syntax. Change: ScrollTrigger.create({ target: ".services-content-heading-inner", start: "top top", end: "bottom bottom", markers: true }); To: gsap.fromTo('.services-content-heading-inner', { yPercent: 100 }, { yPercent: 0, autoAlpha: 1, duration: 2, ease: easeInOut, scrollTrigger: { trigger: '.services-content-heading-inner', start: "top top", end: "bottom bottom", markers: true } } ); Thank you!
  2. Hi Rodrigo, Re-Iteration: Main problem is the incorrect position of the triggers' top and bottom markers. It should be aligned with the triggers' top and bottom edge instead of the documents/<body></body> top and bottom edge. Answers window.addEventListener( "load", function (e) { init(); setInterval(function () { ScrollTrigger.refresh(); }, 100); }, false ); Purpose: To refresh scrollTrigger coordinates due to layout-shift caused by images, fonts, and etc. (Assuming that these things causes an issue). Reference topic: Note: This is just an experiment since I don't have a specific condition to refresh scrollTrigger. However, this seems not to be a problem caused by layout shift. Update: Removed. === gsap.fromTo( ".services-content-heading-inner", { yPercent: 100 }, { yPercent: 0, autoAlpha: 1, duration: 2, ease: easeInOut } ); Purpose: To simply animate the ".services-content-heading-inner" element. === ScrollTrigger.create({ target: ".services-content-heading-inner", start: "top top", end: "bottom bottom", markers: true }); Purpose: To animate the ".services-content-heading-inner" element once it is in viewport. Note: ".services-content-heading-inner" scrollTrigger; I separated this from the animation itself to test if it will solve the triggers' start/end markers incorrect positioning. However, problem still insists which means it is not a issue with the animation. Update: Merged to corresponding animation above. === ScrollTrigger.create({ start: 0, end: "max", onUpdate: updateValues }); Note: The idea is to identify the distance of ".services-content-heading-inner" top edge from the top of the viewport and if the ".services-content-heading-inner" is in viewport (true/false). Got it from this demo, https://codepen.io/GreenSock/pen/WNOzrqg Update: Removed. I apologize, for the confusing code. I have removed all the unnecessary lines and cleaned it up for you. Let me know if you have further questions.
  3. Hey GSAP Team, I have a concern regarding my implementation of "scrollTrigger". The Start/End marker of the triggers isn't aligning correctly with the top and bottom of the triggers. Please focus on the ".services-content-heading-inner" element, as this is what I'm currently experimenting with. My ultimate goal here is to animate this element once it enters the viewport. However, it immediately animates because of how the elements' start/end is positioned. I tried changing the position to start: "center top", end: "center bottom". However, the position is still off and not really at the center of the trigger element. I attempted to change the trigger to the parent element, but the story remains the same. I really want to use scrollTrigger because it seems to be simpler compared to https://gsap.com/docs/v3/Plugins/Observer/. I also tried using https://gsap.com/docs/v3/Plugins/ScrollTrigger/static.isInViewport()/ by wrapping the animation in an if-else condition "ScrollTrigger.isInViewport(element)". However, it doesn't fire the logic inside the condition even if the condition was met. I would appreciate your thoughts and expert advice on where I went wrong or missed. Thank you very much for any assistance.
×
×
  • Create New...