Various Scripts
This is a collection of various scripts written by Morgante Pell. These short scripts are released on an as-is basis under the Apache License 2.0. Enjoy!
JavaScript
Colorizer
Colorizer automatically adds a random background color to all elements on a page. To begin useful CSS debugging, paste the below script within a script block and add a tag of "colorize" to the <body> tag. Requires jQuery.
$(document).ready(function() {
$('body.colorize *').each(function() {
var color = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
$(this).css({'background': color});
})
});