Text Shadow 1.0

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

Please have a look at the "Other Resources" for bug reports or further help on jQuery. Do not post bug reports or feature requests as comments to unrelated articles. If bug reporting on bugtracker.a-framework.org fails, e-mail me.

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

Random jQuery Plug-ins

  • Tag Sizes

    Use this plug-in on a list of tags (li:s) and it will use whatever numbers found in the list to give each tag a corresponding size.

    Details

  • Numeric DL

    This tiny plug-in numbers definitions in a definition-list if there are more than one definition for a term. Can be useful for FAQs, actual lists of d...

    Details

  • Super Simple Tabs

    This is an extremely basic tabs-plugin which allows you to create tabbed content from the ever-so-common list of in-page-links. The plug-in takes one ...

    Details

More Plug-ins

Recent Comments

  1. AL on "Accessible, Stylish Modal Windows With Modern CSS"

    @Matt - What exactly isn't working? "Not working" ...

  2. roboteich on "Accessible, Stylish Modal Windows With Modern CSS"

    This is hardly accessible. Screen reader focus is...

  3. Matt on "Accessible, Stylish Modal Windows With Modern CSS"

    I have tried to implement this, but for some reaso...

Page cached. Loaded in: 0.0072 second(s).
Last DB change: 2010-09-03 17:14:49
Last file change: 2010-08-12 15:31:16
Cache created: 2010-09-03 20:11:01