Animating text-shadow to fade in and out

Viewed 2086

I'm trying to animate text-shadow to fade in and out using the snippet shared here:

Animating elements of text-shadow with jQuery

My code is essentially:

$.fx.step.textShadowBlur = function(fx) {
    $(fx.elem).css({textShadow: '0 0 ' + Math.floor(fx.now) + 'px white'});
};

$("#seconds").animate({textShadowBlur:20}, {duration: 300, complete: function() { 
    $("#seconds").animate({textShadowBlur:0}, {duration: 300}); 
}});

Problem I'm having is that the "fadeout" portion doesn't seem to work. Shadow blur just increases to 20 and then "resets" to 0.

jsfiddle of the problem: http://jsfiddle.net/ANs92/

1 Answers
Related