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 jquery.com 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

  • 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

  • Favicons

    This little plug-in will insert favicons to all external links found on your site. The plug-in scans the URL the link is pointing to for a favicon and...

    Details

  • Togglable DL

    Use this plug-in on your definition-lists (dl-elements) to allow the dd:s for a dt to be toggled when clicking the dt. Don't use it unless it's semant...

    Details

More Plug-ins

Recent Comments

  1. AL on "Chinese New Year in Kuala Lumpur"

    Hehe true, but there's more than one title in that...

  2. Bojan on "Chinese New Year in Kuala Lumpur"

    Unless you're fluent in Japanese, I'd hold off on ...

  3. Mickodemus on "I'm In Thailand!"

    Seems splendilicious mate! I can't wait to get a d...

Page cached. Loaded in: 0.0067 second(s). Last DB change: Wednesday 10th of March 2010, Last file change: Wednesday 10th of March 2010, Cache created: Wednesday 10th of March 2010