Skip to content

Instantly share code, notes, and snippets.

@commana
Created July 18, 2011 06:33
Show Gist options
  • Save commana/1088684 to your computer and use it in GitHub Desktop.
Save commana/1088684 to your computer and use it in GitHub Desktop.
An old school 'work in progress' indicator.
function rotating_indicator(indicator) {
var element = document.getElementById(indicator),
type = element.innerHTML,
next_type = "/";
switch (type) {
case "\\": next_type = "|"; break;
case "|": next_type = "/"; break;
case "/": next_type = "\u2014"; break;
case "\u2014": next_type = "\\"; break;
}
window.setTimeout(function () {
element.innerHTML = next_type;
rotating_indicator(indicator);
}, 150);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment