Skip to content

Instantly share code, notes, and snippets.

@stefanocudini
Created March 25, 2012 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stefanocudini/2193439 to your computer and use it in GitHub Desktop.
Save stefanocudini/2193439 to your computer and use it in GitHub Desktop.
ascii ajax spinner, jquery
$(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