On Wed, 30 Aug 2006 15:20:21 +0200, Bjoern Hoehrmann <[EMAIL PROTECTED]>
wrote:
> * Nazar wrote:
>> I use DOM to add some of the elements to SVG. Currently I use
>> element.setAttribute("x", _x); to position element absolutely.
>>
>> What I am interested in is
>> how to position elements relative to its parent element ?
>
> Impossible. All you can do is determine the position of the parent and
> change your setAttribute call to take that into account.
Well, you could use relative values (x='10%' for example) if you have an
applicable enclosing viewport. It's not what you're asking for since it's
not relative to its parent but to the viewport. A 'symbol' might be the
closest you get to the desired behaviour, short of calculating everything
in script.
This is what SVG 1.1 says:
"The following elements establish new viewports:
- The 'svg' element
- A 'symbol' element define new viewports whenever they are instanced by
a 'use' element.
- An 'image' element that references an SVG file will result in the
establishment of a temporary new viewport since the referenced resource by
definition will have an 'svg' element.
- A 'foreignObject' element creates a new viewport for rendering the
content that is within the element."
Hope it helps
/Erik
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/