A jQueryplugin
that applies highlight and shadow effects to text in a control.
The current version is 1.0.0 and is available
under the MIT licence.
For more detail see the documentation reference page.
Or see a minimal page that you could
use as a basis for your own investigations.
The label effect functionality can easily be added to a control containing text
with appropriate default settings.
You can also remove the label effect functionality if it is no longer required.
You can customise any of the settings to achieve your own effect.
There are two aspects to the effects - a highlight and a shadow.
Each can have its own colour, direction, and distance.
You can also have the effect fill the intervening space
and even blend from the main colour to the effect colour.
This tab highlights examples of this plugin in use "in the wild".
None as yet.
To add another example, please contact me (kbwood.au{at}gmail.com)
and provide the plugin name, the URL of your site, its title,
and a short description of its purpose and where/how the plugin is used.
Quick Reference
A full list of all possible settings is shown below.
Note that not all would apply in all cases. For more detail see the
documentation reference page.
$(selector).labeleffect({
color: '', // Main text colour
hiColor: 'silver', // The highlight colour
hiDir: this.NONE, // The highlight direction
hiOffset: 0, // The highlight offset
hiFill: false, // True to fill from main text to highlight
hiBlend: false, // True to blend from main color to highlight
shadowColor: 'silver', // The shadow colour
shadowDir: this.DOWNRIGHT, // The shadow direction
shadowOffset: 5, // The shadow offset
shadowFill: false, // True to fill from main text to shadow
shadowBlend: false, // True to blend from main color to shadow
effect: '' // A preset effect
});
$.labeleffect.setDefaults(settings) // Change settings for all instances
$.labeleffect.addEffect(id, settings) // Add a new named effect
$.labeleffect.getEffects() // Retrieve a list of named effects
$(selector).labeleffect('option', settings) // Change the instance settings
$(selector).labeleffect('option', name, value) // Change a single setting
$(selector).labeleffect('option', name) // Retrieve a setting
$(selector).labeleffect('destroy') // Remove the label effect functionality
Usage
Include the jQuery library in the head section of your page.
Alternately, you can use the packed version
jquery.labeleffect.pack.js (4.4K vs 11.4K), or the minified version
jquery.labeleffect.min.js (5.4K, 1.9K when zipped).
Connect the label effect functionality to your text controls.
$(selector).labeleffect();
You can include custom settings as part of this process.