On Wed, 12 Nov 2008 20:14:24 +0100, Luis Vielva <[EMAIL PROTECTED]> wrote:

> Dear svg developers,
>
> When I change the xlink:href attribute of an <image> element
> in svg I would expect the displayed image to change. It works
> as expected in IE with ASV, firefox, chrome and safari. But
> I have had to way to change the displayed image in Opera
> (if the possible images are known beforehand you could always
> put a sequence of <image> and play with the display attribute,
> but it is not the way I would like to do it).
>
> Does any one of you know if Opera supports that dynamic
> change of a displayed <image> ?

It is supported in Opera. You may be running into issues if you use the 
non-namespace-aware DOM methods (set/getAttribute) though.

Here are some ways you can set the xlink:href:

 - With an animation element, e.g <set attributeName="xlink:href" 
to="http://foobar.com/"; />
 - With script:
   - elm.setAttributeNS("http://www.w3.org/1999/xlink";, "xlink:href", 
"http://foobar.com";)
   - elm.setAttributeNS("http://www.w3.org/1999/xlink";, "href", 
"http://foobar.com";)
   - elm.href.baseVal = "http://foobar.com";; (working example see here[1])
   - elm.setTraitNS("http://www.w3.org/1999/xlink";, "href", "http://foobar.com";)

My vote goes to elm.href.baseVal, which AFAIK works fine in all of the viewers 
you mention.

Hope this helps
/Erik

[1] 
http://svgopen.org/2008/presentations/70-Tricks_of_Javascript_and_declarative_animation/index.html#slide13

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

------------------------------------

-----
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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> 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/

Reply via email to