diff --git a/index.html b/index.html index b3625db..a66ac85 100644 --- a/index.html +++ b/index.html @@ -24,31 +24,28 @@ Coding is
+ var words = ["fun", "exciting", "about\u00A0not\u00A0giving\u00A0up", + "being\u00A0helpful", + "being\u00A0open", + "what\u00A0I\u00A0learned\u00A0at\u00A0CodingDojo!"], + el = document.getElementById('magic'), + word_counter = 0, + character_counter = 0; + function updateText() + { + el.innerHTML = el.innerHTML+words[word_counter][character_counter++]; + if(character_counter == words[word_counter].length+1) + { + word_counter++; //choose a different word + character_counter = 0; //start over with the first character of the word + el.innerHTML = ''; //set the html to be blank + //if we're displaying the last word, go back to the first word + if(word_counter == words.length) + word_counter = 0; + } + } + setInterval(updateText,600); +