You do not need to use any external plugins, you can only do this with jQuery 1.8 and css3 , but it is not easy. You need to combine the css3 property text-shadowwithanimate()
UPDATE: Bugs fixed.
The blue effect of jsFiddle works here.
JQuery
var red = $(".red");
red.click(function() {
if ( !$(this).is(':animated') )
red.glowEffect(0,40,500);
});
$.fn.glowEffect = function(start, end, duration) {
var $this = this;
return this.css("a", start).animate({
a: end
}, {
duration: duration,
step: function(now) {
$this.css("text-shadow","0px 0px "+now+"px #c61a1a");
}
});
};
CSS
.red { text-shadow: 0px 0px 0px #c61a1a; }
Note. No need to define provider prefixes such as -webkit- -ms- -moz- -o-jQuery 1.8 fixes this automatically.
Source: I asked a question last week, and it came up with great answers:
How to combine jQuery animation with css3 properties without using css transitions?
source
share