Is there any way to detect if a computer is slow and not run some code (by either turning jQuery animations off or just running a function if it is fast)?
I kno
When running javascript, you don't have the luxury of knowing the target computer's performance beforehand. The only thing I can think of, would be to run a function doing some calculations and measuring the time taken. The function must do a sufficient number of calculations in order to make sure that the time taken to run, is representative of the performance of the machine.
In general, I would advise against doing such a performance test, because it takes resources on the target machine, something that users generally don't like. But perhaps you could measure the time taken to complete the first animation, and if it is too slow, disable subsequent ones.