Gsap .from doesnt work with useEffect[]
Im learning now GSAP, so I think it's a really simple question, anyway, the documentation says this:
Whenever I refresh the site, it happens what you see in the GIF https://i.imgur.com/JrVzB11.gif, the animation "glitches", why? I tried to make the animation start when I click the div and it works fine, it start 200px off and then gets in the right position (but it glitches if you click it before the animation ends https://i.imgur.com/owuOWU7.gif, here I first make it end, then I click quickly)
b1mind•488d ago
Have you read through this? https://greensock.com/react-advanced/
There is another started guide for gsap in react but I can't find it atm
cause I'm blind lol https://greensock.com/react/
lko•488d ago
Thank you, no I didnt read it
I'll read it later, and I'll see if I can fix my problem. Thanks again @b1mind
JWode•488d ago
I can't remember whether it's an issue with just
fromTo
or from
as well, but have you tried immediateRender: false
? https://greensock.com/immediaterender/
9 times out of 10 that's the issue when I've got glitching animationsGreenSock
immediateRender demystified
The immediateRender property of from() and fromTo() tweens is one of those things you only find out about when it gives you unexpected results. from() and fromTo() tweens are special as they set immediateRender to true as soon as they are created. This helps especially when creating staggered bui...
JWode•488d ago
*there you go in the description, it's
from
as well.lko•487d ago
@b1mind Thank you, i read the documentation and now im able to make most of my things work, although there are a few problems:
I think Im using the useLayoutEffect correctly, but it's giving me this error:
And also, it cant found
.singleLetter
, any suggestion?b1mind•487d ago
I don't use React
Creates overcomplicated problems specially when working with a lib that's meant to work with the real Dom.
lko•487d ago
Ok
Thanks anyway
A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.
34KMembers
View on DiscordWant results from more Discord servers?
More PostsFinding the skewed offset of an elementI've a full width container, that has a `before` pseudo element that's 3/5's the width absolutely poSharp and Canvas error on NodeI have a project I'm trynna run for the first time, the codebase is an API backend written with exprtwo Filters on clickhere how can I add current and exits filter for all tabs, based on class or data setRetrieve and display the skuI need this H3 to display the sku of our products in Magento 1.9
<h3 class="product-name<?php echoOutput the skuI need this line of code to retrieve and display the sku and so far I cannot get it to echo the sku.NPM Package publishing setup done right... well, it saves you time.https://youtu.be/eh89VE3Mk5gVite issue with using local/custom fontsI'm trying to load a custom font:
`@font-face {
font-family: "Bellafair-Regular";
src: local("@is there a better way than performance.now() to tell how long the execution took?is there like a 1 line solution i think i saw someone who did it once but i can't remember but is thCan I add animations to this project?Project link: https://glistening-bombolone-928636.netlify.app/
I would like to try adding animationError message for no reasonI am just getting started with backend development with flask and it is showing an error messageNeed a CSS expert (Tailwindcss)I am trying to figure out chatGPT manage to stick the prompt area to the bottom. I copied their codeHelping you achieve the Grid Layout you wanthttps://grid.layoutit.com/Pseudo -elementPseudo-element z-index not working , I want the gradient background to be behind the parent element <datalist> inconsistencies across browsersIs there any reason why Firefox displays only text between the closing and opening `option` tag, whiLow-Visibility Font> What makes it different from traditional typography design is that it focuses on letterform distinhow to use gradient with variableslinear-gradient(rgb(var(--main-color-1)),rgb(var(--main-color-2)) )
why this is not workingRemarksAm not a UI/UX designer, I've been working and don't have a portfolio decided to make one at least 5RegEx with match() and replace()I have a regular expression that grabs the double quotes and value for an html tag attribute: `str.Occasional JS error from fast clicking?This error is popping out occasionally in console, from I'm guessing, clicking too fast? When I'm sWhy is this giving me an error?```js
for(let i=0;jobCard.length;i++){
if(jobCard[i].classList.contains('hidden')) {