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 ☺️
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.