For the final option, there's still another option that is likely more peformant?
Using the transitionend event would allow you to use the code from the second example and then just set the width of the inner bar back to 0 if the queued length > 0.
This prevents you from having to setTimeout, manually animate, and have that width value be global-ish.
For the final option, there's still another option that is likely more peformant?
Using the
transitionend
event would allow you to use the code from the second example and then just set the width of the inner bar back to 0 if the queued length > 0.This prevents you from having to setTimeout, manually animate, and have that width value be global-ish.
This is an awesome idea. I suspected that something like this would be possible. It definitely sounds more performant.
I knew the community would have some cool ideas about this problem. Iβd love to see this coded up βΊοΈ