Created
April 4, 2016 02:48
-
-
Save jbrz0/581d65a3edcd72fc171de83abd18e0dd to your computer and use it in GitHub Desktop.
jQuery random colour div
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
// Requires jquery color | |
$(document).ready(function() { | |
spectrum(); | |
function spectrum(){ | |
var hue = 'rgb(' + | |
(Math.floor(Math.random() * 256)) + | |
',' + (Math.floor(Math.random() * 256)) | |
+ ',' + (Math.floor(Math.random() * 256)) | |
+ ')'; | |
$('#welcome').animate( { backgroundColor: hue }, 1000); | |
spectrum(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment