Created
August 18, 2015 07:18
-
-
Save yyolk/de1aa8b2f5ca3723af8a to your computer and use it in GitHub Desktop.
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
/* | |
Joseph Chiocchi | |
Word Flash | |
Description: | |
Takes some text, and flashes one word at a time to the screen. | |
*/ | |
var text = $("#ccontent").text(); | |
var countmax; | |
var c=0; | |
function wordr(){ | |
splt = text.split(" "); | |
countmax = splt.length; | |
if(c%2===0){ | |
$('body, #back').css('background-color','white'); | |
$('body, #back').css('color','black'); | |
}else{ | |
$('body, #back').css('background-color','black'); | |
$('body, #back').css('color','white'); | |
} | |
$("#wordflash").text(splt[c]); | |
c=c+1; | |
if (c>countmax) | |
c=0; | |
setTimeout("wordr()", 250); | |
} | |
wordr(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment