Submit your widget

Button illuminate with jQuery

Created 12 years ago   Views 12705   downloads 2434    Author admin
Button illuminate with jQuery
View DemoDownload
63
Share |

Ever wanted to add a little flare or shine to your CSS buttons? Perhaps, you want to attract more attention to your buttons and textboxes by making them stand out or illuminate. Well, with the jQuery illuminate plug-in you can do just that.

Unfortunately, this plug-in is not fully compatible with Firefox version 4 or greater. The plug-in will work; however, the outerGlow not be shown with Firefox 4 or greater.

Include all necessary javascript files:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery.illuminate.0.7.min.js"></script>

Create Your CSS/HTML object

<div id="button" style="background:#98cb00">Click Me</div>

Illuminate the CSS/HTML object

<script type="text/javascript">
$(document).ready(function(){
$('#button').illuminate();
});
</script>
Options

jQuery illuminate has several options which allow you to customize the illumination effect. The options are shown below:

Key
Default Value
Description
intensity
0.05
Intensity of the illumination 0.00% – 1.00%
color
(blank)
illuminate color (default is background color)
blink
true
illumination will pulse/blink on and off
blinkSpeed
600
# of millisectionds to pulse/blink on and off
outerGlow
true
true or false whether to add an outer glow effect
outerGlowSize
30px
the size of the outerGlow illuminate
outerGlowColor
(blank)
outer glow color (default is background color)

To add any or all of these options, the code would look as follows:

<script type="text/javascript">
$(document).ready(function(){
$('#button').illuminate({
'intensity': '0.3',
'color': '#98cb00',
'blink': 'true',
'blinkSpeed': '1200',
'outerGlow': 'true',
'outerGlowSize': '30px',
'outerGlowColor': '#98cb00'
});
});
</script>

The article source:http://www.tonylea.com/2011/jquery-illuminate/

Tag: button