jQuery Plugin For Random Background Color - randomBG

jQuery Plugin For Random Background Color - randomBG
File Size: 2.21 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

randomBG is a tiny, funny jQuery plugin which randomly changes the background color of a specific container on each page load.

How to use it:

1. Place jQuery library and the jQuery randomBG plugin's script at the bottom of the webpage.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="jquery.randombg.js"></script>

2. Call the function on the target container and the plugin will do the rest.

$("body").randombg();

3. You can also specify the init hex color for the background.

$("body").randombg({
  color: '0c5672'
});

This awesome jQuery plugin is developed by fparreira. For more Advanced Usages, please check the demo page or visit the official website.