DEV Community

Discussion on: Displaying a css spinner on ajax calls with fetch api

Collapse
 
link2twenty profile image
Andrew Bone

Getting JavaScript to interact with CSS is a really good way to handle this.

Just for personal preference, I'd probably use the built-in hidden attribute, rather than having a show class. I'd also animate as small an area as possible by moving the spinner to a pseudo-class.

Great work 🙂

Collapse
 
codeonjim profile image
CodeOnJIm

Oh this is good! spinner is gone as the promise is resolved!