I want to read:
width
,height
,x
,y
measurements
for a particular SVG element.
I suppose that easiest way to go about this is to fetch the minimum bounding box first and read it's properties.
How can I access this?
I want to read:
width
,height
,x
,y
measurementsfor a particular SVG element.
I suppose that easiest way to go about this is to fetch the minimum bounding box first and read it's properties.
How can I access this?
If you have a reference to the DOM node, use
https://developer.mozilla.org/en-US/docs/DOM/element.getBoundingClientRect
Edit: SVG Edit has a method to return currently selected elements:
so in the above example:
Please see http://granite.sru.edu/~ddailey/svg/BBox0M.svg for the example and answer.
In brief, this code works for me in Chrome:
I'm not sure if I'm understanding you correctly, but if you're looking to get the height or width of a jQuery element, use width() and height():
JSFiddle example: http://jsfiddle.net/gGWU4/
Assuming you have a handle to the element, I would think that this would work, no?