Jump to content
Search Community

Rabeegsap

Members
  • Posts

    4
  • Joined

  • Last visited

Rabeegsap's Achievements

  1. gsap.to works fine, my issue with gsap.from If I call gsap.from using a button, it works fine but if it is inside useEffect then it will not work this code below not working: useEffect(() => { gsap.from(".h1", { x: -2500,duration:1 }); }); this one works fine: function App() { const clicked = () => { gsap.from(".h1", { x: -2500,duration:1 }); }; useEffect(() => { }); return ( <div className="App"> <h1 className="h1">Hello</h1> <h1 className="x500">X=500</h1> <button className="btn" onClick={() => clicked()}> click me </button> </div> ); }
  2. Actually, I just created a react app then npm i gsap , I am not sure what is going on its just a simple code.
  3. Hi, I used to set the CSS for the elements then use gsap.from to animate them from a position A to their default position in the CSS. using margin for relative elements and left or right for absolute ones. Now gsap.from is not animating elements properly Please help,
×
×
  • Create New...