views:

326

answers:

0

I'm very much a noob so please forgive me if there's a "duh" solution here.

Is there a good, or at least a simple, way to animate things like shadowColor or shadowBlur with jQuery? E.g. If I have something like:

function draw(){
var canvas = document.getElementById(elem);
if (canvas.getContext){
    var draw = canvas.getContext('2d');
    if (!draw) {    
        return;
    }
    ...
    draw.shadowBlur = 3;
    draw.font = '16px verdana, sans-serif';
    draw.fillText('hello sailor', 0, 0);
    ...etc.
}

}

and then, later, want to animate draw.shadowBlur using jQuery syntax, e.g. animate making the type legible on hover.

$('#el').hover(function(){ $(elem).animate({ shadowBlur: 0 }, 300); }, function(){ $(elem).animate({ shadowBlur: 1 }, 300); });

I suspect I'm failing to grok something basic and fundamental despite much googling and would really appreciate an example/how to for this scenario.

Thanks to anyone willing to take the time to respond.