Text Shadow 1.0

Created Friday 17th of October 2008 by Andreas Lagerkvist
Copyright © 2008 Andreas Lagerkvist (andreaslagerkvist.com)

What it Does

Frankly a rather crappy text-shadow plug-in (can one be done well? :) but nevertheless it does the job in some cases.

How to Use

jQuery('h2').textShadow(); would give every h2 a shadow.

Example

I should have a shadow.

Example Code

HTML

<div id="jquery-text-shadow-example">
<
p>I should have a shadow.</p>
</
div>

JS

jQuery('#jquery-text-shadow-example p').textShadow();

Source Code

jQuery.fn.textShadow = function () {
    return 
this.each(function () {
        var 
el = $(this);

        
el.html('<span class="jquery-text-shadow-text">' el.html() + '</span>').css('position''relative');
        
jQuery('<span class="jquery-text-shadow">' el.text() + '</span>').appendTo(el);
    });
};

Download

Plug-in

Requires

Post a Comment

blog comments powered by Disqus

Random jQuery Plug-ins

  • Colour Picker

    Use this plug-in on a normal <select>-element filled with colours to turn it in to a colour-picker widget that allows users to view all the colours in...

    Details

  • Removable File Upload

    This plug-in adds a "remove"-link next to input[type=file]:s that allows the user to remove a selected file from the input.

    Details

  • Max Length Form Controls

    Gives form-controls with a 'maxlength-XXX'-class a max-length and prohibits user from entering more than set amount. It also displays number of charac...

    Details

More Plug-ins

Recent Comments

Powered by Disqus