Last active
June 7, 2016 22:15
-
-
Save samusgray/1c71323c782664efda78 to your computer and use it in GitHub Desktop.
reveal.js subliminal messages
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
var images = [ | |
'<img src="img/starbucks.png">', | |
'<img src="img/google.png">' | |
]; | |
var flash = function(id, image) { | |
var target = document.getElementById(id); | |
var goodHTML = target.innerHTML; | |
target.innerHTML = image; | |
setTimeout(function() { | |
document.getElementById(id).innerHTML = goodHTML; | |
}, 1) | |
}; | |
setInterval(function() { | |
flash('current', images[Math.floor(Math.random()*images.length)]); | |
}, 20000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment