Skip to content

Instantly share code, notes, and snippets.

@bouveng
Forked from stefanocudini/asciispinner.js
Created October 29, 2015 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bouveng/56d4b836b3ba162d7b78 to your computer and use it in GitHub Desktop.
Save bouveng/56d4b836b3ba162d7b78 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