javascript - Raphael setting the attr of an element -
i using raphaeljs add need set attributes on element, attributes name , value saved in variables
var attr_name='fill'; var attr_value='#343434';
but following not work
exampleelement.attr({attr_name: attr_value});
however if type in actual name in attr field works
exampleelement.attr({'fill': attr_value});
i have tried wrapping in quotes , double quotes has no effect.
please can suggest anything? not option manually type them in code runs in loop , each time different attribute setting.
Comments
Post a Comment