Created
July 18, 2011 06:33
-
-
Save commana/1088684 to your computer and use it in GitHub Desktop.
An old school 'work in progress' indicator.
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 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