Forums.ATC.no

Teknisk => Generelt teknisk => Emne startet av: ATC på 18. Juli 2010, 17:55 pm

Tittel: SVG+Javascript: Get or set element properties
Skrevet av: ATC18. Juli 2010, 17:55 pm
How do I access the current SVG element properties, and how do I change them?

Tittel: [Solved] SVG+Javascript: Get or set element properties
Skrevet av: ATC18. Juli 2010, 17:55 pm
Access the current value of a circle element (assuming 'object' references the circle):
posx = object.cx.baseVal.value;

Change the value of a that same element:
object.style.setProperty('cx', posx, '');