On Thu, 26 Apr 2007 21:47:14 +0200, sirlemmingviii <[EMAIL PROTECTED]>  
wrote:

> No idea why this isn't working:
>
> IN SVG SECTION
>
> //the image to be changed
> <image id="bg" x="0" y="0"  width="100%" height="100%"
> xlink:href="trees_640x480.jpg" />
>
> //thumbnail images
> <image id="tree_small" x="76%" y="81%" width="4%" height="4%"
> xlink:href="trees_640x480.jpg" onclick="wallpaperSelect(evt)"/>
> <image id="mell_small" x="81%" y="81%" width="4%" height="4%"
> xlink:href="mellinger_640x480.jpg" onclick="wallpaperSelect(evt)"/>
>
> IN SCRIPT SECTION
>
> function wallpaperSelect(evt)    //called when a thumbnail is clicked on
> {
>    switch (evt.target.id)
>    {
>      case "tree_small":
>        document.getElementById('bg').setAttributeNS(null, 'href',
> "trees_640x480.jpg");
>        break;
>      case "mell_small":
>        document.getElementById('bg').setAttributeNS(null, 'href',
> "mellinger_640x480.jpg");
>        break;
>      default:
>        alert("FAILURE");
>    }
>    //show what bg's "href" attribute is now set to
>    alert("Switched to " +
> document.getElementById('bg').getAttributeNS(null, 'href'));
> }

You should set xlink:href, with the xlink namespace. I would recommend  
something like this:
document.getElementById('bg').setAttributeNS("http://www.w3.org/1999/xlink";,  
"xlink:href", "trees_640x480.jpg");

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

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