Live data from Hacker News

Spin.js, a pure JS spinner

fgnass.github.com

1–10 of 70 posts

Re: Spin.js, a pure JS spinner

#2
I think the possibility of dynamically changing the speed of the spinner is interesting. If your spinner was representing a file upload, for example, you could conceivably adjust the speed based on the current upload rate.

Re: Spin.js, a pure JS spinner

#8

I hate to be that guy but this takes up 45% cpu under firefox for a simple spin animation.

I see the same problem in Opera too, except it's even worse (the animation lags, and it hogs a whole CPU core).

Explorer is better than Firefox and Opera, but still pretty high CPU usage.

The only browser of the ones I tested that it seems to be relatively fine in is Chrome.

Re: Spin.js, a pure JS spinner

#9
post #3

A spinner generated from http://www.ajaxload.info/ is 673 bytes. The minified javascript from this is ~3K. I suppose the trade off is features and flexibility, but I don't find myself needing much out of my ajax spinners.

Agreed... This is fine as an exercise but I don't want to maintain code for every minor component; I'd rather go with an image even if it were bigger than 3K.

Re: Spin.js, a pure JS spinner

#10
post #3

A spinner generated from http://www.ajaxload.info/ is 673 bytes. The minified javascript from this is ~3K. I suppose the trade off is features and flexibility, but I don't find myself needing much out of my ajax spinners.

The site is great. Thanks for the find.
Post reply on HN