Random Bokeh Background with jQuery and Canvas - bokehBg
File Size: | 3.07 KB |
---|---|
Views Total: | 2290 |
Last Update: | |
Publish Date: | |
Official Website: | Go to website |
License: | MIT |

bokehBg is an easy jQuery plugin that creates a random bokeh background for a specified container using Html5 canvas
element.
How to use it:
1. Include jQuery library and the jQuery bokehBG.js script in the web page.
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="bokehbg.js"></script>
2. Create a container element you wish to apply a random bokeh background to.
<div id="bgArea"></div>
3. Call the plugin to draw random bokeh effect on the <code>canvas</code> and apply it to the background of your container.
$(document).ready(function(){ $("#bgArea").bokehBg(); })
4. Default settings.
$(document).ready(function(){ $("#bgArea").bokehBg({ total_light_particles: 150, background_color:'#444', max_particle_radius:70, min_particle_radius:20, log_number_of_particles:false }); })
This awesome jQuery plugin is developed by jabahar. For more Advanced Usages, please check the demo page or visit the official website.