Created
March 25, 2012 12:52
-
-
Save stefanocudini/2193439 to your computer and use it in GitHub Desktop.
ascii ajax spinner, jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var spins = [ | |
"←↖↑↗→↘↓↙", | |
"▁▃▄▅▆▇█▇▆▅▄▃", | |
"▉▊▋▌▍▎▏▎▍▌▋▊▉", | |
"▖▘▝▗", | |
"┤┘┴└├┌┬┐", | |
"◢◣◤◥", | |
"◰ ◳ ◲ ◱", | |
"◴◷◶◵", | |
"◐◓◑◒", | |
"|/-\\"]; | |
var spin = spins[0], | |
title$ = $('title'), | |
i=0; | |
setInterval(function() { | |
i = i==spin.length-1 ? 0 : ++i; | |
title$.text('('+ spin[i] +') Loading...'); | |
},300); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment