Created
November 30, 2015 17:03
-
-
Save jmahony/072e63f85385e2bb53a9 to your computer and use it in GitHub Desktop.
Simple script to make things easier to line up
This file contains hidden or 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
function coloursize() { | |
$('.colourise').each(function() { | |
var $el = $(this); | |
setBackgroundColour($el); | |
$el.find('*').each(function() { | |
setBackgroundColour($(this)); | |
}); | |
}); | |
function getRandomColour() { | |
return '#'+Math.floor(Math.random()*16777215).toString(16); | |
} | |
function setBackgroundColour($el) { | |
$el.css('background', getRandomColour()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment