View on GitHub

Random Color

Random Color Jquery Plugin

Download this project as a .zip file Download this project as a tar.gz file

Random Color jQuery Plugin

Random color add any text in website. Lightweight jquery plugin uncompressed 3kb.

Random color

Demo

Basic Usage

Include jQuery and randomColor into your document's <head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/randomColor.js"></script> <!-- randomColor -->

Call the function as follows:

$('h2').randomColor({
    random: true,
    colors: ["#216FF1", "#D5412D", "#FFC407", "#009856"],
    css: {
        'color': '#86C9EF',
        fontStyle: 'oblique',
        'fontSize': '30px'
    },
    complete: function () { alert('Done!') }
});

Documentation

Available options

Name Description
css Customizable CSS write property.
colors Custom colors collection array.colors: ["#216FF1", "#D5412D", "#FFC407", "#009856"]
Array; Default value: null
random If you can not color change randomly then put false.
Boolean; Default value: true

Callbacks

Name Description
complete Called after complete process.