I'm trying to dynamically rotate a gradient in an SVG based on mouse position and it's all working fine except this one line. The trouble is I can't seem to get the jQuery attr
method to work. setAttribute
works fine to replace rotate(#,#,#)
inside of the attribute gradientTransform
but attr
doesn't. The part that I'm really having trouble with is that I can change other attributes with attr
(as in the third example in the fiddle).
http://jsfiddle.net/samt/8yUNL/
this one works
mainLogoFill[0].setAttribute('gradientTransform', 'rotate(45,100,100)');
this one doesn't
mainLogoFill.attr('gradientTransform', 'rotate(90,100,100)');
this one throws me.. why does it work?
mainLogoFill.attr('x1', '100');