Last active
August 29, 2015 14:15
-
-
Save MarcBalaban/53051e3c76871770ca69 to your computer and use it in GitHub Desktop.
Party Time
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 partyTime = function(domElement) { | |
if(domElement.tagName === "DIV"){ | |
domElement.style.background = "#" + Math.random().toString(16).slice(2, 8); | |
} | |
var domChildren = domElement.children; | |
for(var x = 0; x < domChildren.length; x++){ | |
partyTime(domChildren[x]); | |
} | |
}; | |
setInterval(partyTime.bind(this,document.body),150) | |
var music = "http://marcbalaban.com/wp-content/uploads/Everybody-dance-now-lyrics-P.mp3" | |
var audio = document.createElement("audio"); | |
audio.src = music | |
document.body.appendChild(audio); | |
audio.play(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment