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

blog comments powered by Disqus

Random jQuery Plug-ins

  • Slide Presentation

    A sort of slide/presentation kind of plug-in. Displays sliding images with text floating on top. This one's pretty specific but perhaps someone will f...

    Details

  • Equal Height

    This plug-in makes HTML-elements equal height by adjusting their min-height CSS properties. Of course IE6 has no clue what min-height means so the plu...

    Details

  • Content Scroller

    Use this plug-in to make a list of elements only show one at a time and every now and then scroll to the next one. The plug-in scrolls in infinty, sta...

    Details

More Plug-ins

Recent Comments

Powered by Disqus
Page cached. Loaded in: 1.1729 second(s).
Last DB change: 2012-04-02 11:06:05
Last file change: 2012-04-25 20:30:39
Cache created: 2012-05-18 09:39:53