How to change the color of svg objects imported into raphaeljs?
I imported a .svg file into raphael and I would like to be able to change
the fill colors and stroke colors of the shapes.
my_set = my_paper.importSVG( my_svgXML ) ;
for( var i = 0 ; i < my_set.length ; i++ )
{ var lvo_element = my_set[ i ] ;
lvo_element.attr( { 'fill' : '#fafafa' } ) ;
console.log( lvo_element.attrs.fill ) ;
// correctly outputs '#fafafa'
}
... but the elements' colors are not updating. However, lvo_element.glow()
does work.
NOTE:
I used jquery.ajax to load my.svg into app
I used raphael-svg-import.js for importing it into raphael
No comments:
Post a Comment