I'm using this as a loading animation for a PhoneGap application. You'll have to adjust the variables to suite your needs. It may not be the most efficient script, so please let me know if you make an update.