Jump to content
Search Community

Mike Hart

Members
  • Posts

    2
  • Joined

  • Last visited

Mike Hart's Achievements

  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Thanks mikel This looks like the way forward. How can I import ScollTrigger. Im using webpack with npm and cant see any references in repo?
  2. Hi there, hope you can help. Im using GSAP3 latest version. For some reason the stagger property gets ignored when used in the js interesection observer api. Works fine on its own. // on its own, stagger works fine gsap.fromTo(".card", { x: '100%' } , { stagger: 0.5, x: 0, duration: 2, ease: "power2.out" }); // not when called with js observer const options = { rootMargin: "0px", threshold: 0 }; const moveup = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.intersectionRatio > 0) { console.log(entry.ta); // the fromTo gets fired but not the stagger gsap.fromTo(entry.target, { x: '100%' } , { stagger: 0.5, x: 0, duration: 2, ease: "power2.out" }); moveup.unobserve(entry.target); } }); }, options); const targetElements = document.querySelectorAll(".card"); for (let element of targetElements) { moveup.observe(element); } thanks in advance.
×
×
  • Create New...