Jump to content
Search Community

Time responding to animation

Rezpo test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi,

 

I'm doing this login interactive animation, but for some reason there is a bug when I erase all the content on the inputs by holding the erase key, it doesn't go back to original position as I hope, it dissorder all the elements, but instead if I do it by pressing the erase key once at a time for each character works perfect...

 

Can you help me?

 

My best regards

 

See the Pen pxvgXa by reezppo (@reezppo) on CodePen

 

See the Pen pxvgXa by reezppo (@reezppo) on CodePen

Link to comment
Share on other sites

I notice two problems: 

 

1) You've specifically coded it not to work when the field is empty: 

 

if (x != null && x.length > 0 && x.length <= 9) {

 

So you should get rid of that condition or rework it somehow (I'm not sure exactly what you're trying to do). 

 

2) oninput seems to fire before the new value is registered in the input, so maybe try changing it to:

onkeydown="setTimeout(inputVal, 1)"

 

We really try to keep these forums focused on GSAP-specific problems. General questions like this are probably better suited to a place like Stack Overflow. 

 

Happy tweening!

  • Like 4
Link to comment
Share on other sites

On 10/2/2018 at 2:46 AM, GreenSock said:

I notice two problems: 

 

1) You've specifically coded it not to work when the field is empty: 

 


if (x != null && x.length > 0 && x.length <= 9) {

 

So you should get rid of that condition or rework it somehow (I'm not sure exactly what you're trying to do). 

 

2) oninput seems to fire before the new value is registered in the input, so maybe try changing it to:


onkeydown="setTimeout(inputVal, 1)"

 

We really try to keep these forums focused on GSAP-specific problems. General questions like this are probably better suited to a place like Stack Overflow. 

 

Happy tweening!

So sorry for the inconvenience, this was very helpful...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...