Return to Snippet

Revision: 21260
at December 8, 2009 08:09 by neal_grosskopf

Initial Code

(function ($) {
$.fn.textShadow = function(shadowcolor,x,y) {
return this.each(function(i){
var parent = "tsw-" + Math.floor(Math.random()*100000);

//Create container
$(this).wrap('<div class="text-shadow-wrapper" id="' + parent + '"></div>');

//Set height of container so that it properly overflows
$("#" + parent).css("height", $(this).css("font-size")); //Math.abs()??

//Add text-shadow class to initial element

//Adds shadow HTML element
$(this).before('<span class="shadow">' + $(this).text() + '</span>');

//Positions shadow HTML element
$("#" + parent + " .shadow").css({left: x, top: y, color: shadowcolor});

Initial URL

Initial Description
Internet Explorer does not support a standards compliant way to create text shadows. Learn how to emulate the CSS3 feature with this jQuery plugin.

Initial Title
A jQuery Plugin To Create CSS3 Text-Shadows In Internet Explorer

Initial Tags
css, ie, jquery, CSS3

Initial Language