Re: [svg-developers] SVG tag which specifies the data of the layer for an element.
- Naveen wrote:
>Ex: If there are 2 elements present in the svg file where one element is present in 1st layer and the other is present in the 2nd layer. Which tag represents the layer data for the elements?I gather that you are looking for something like a z-index in HTML. In SVG, this is just the rendering order (within the parent node) . So I suppose if you don't know where something is, you could retrieve its parent, and then loop through the children of the parent keeping track of the index until you find the node in question -- that would be the rough equivalent of its stacking order.
The question often arises when you wish to change the stacking order (front to back) of objects. This is typically done by removing an object in the middle of the stack and appending it either to the front or bottom of the stack to move it up or down. I think Andreas Neumann has some nice examples at http://www.carto.net/papers/svg/manipulating_svg_with_dom_ecmascript/ , and I found another one by googling http://wiki.svg.org/Rendering_Order (unfortunately it isn't loading right now, but I suppose that is just a temporary thing).
Hope this helps
[Non-text portions of this message have been removed]