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'));
}
So here's what it is: a group of thumbnails of images. When I click on
one I want it to replace the image in the first <image> element, named
"bg". Sure enough, the onclick event fires and the "Switched to..."
alert pops up, and it looks like everything works. Except that the
image doesn't get replaced.
For example, when I click on the "mell_small" image, the alert displays
"Switched to mellinger_640x480.jpg". And it's getting that right from
bg's href attribute, so I don't know why the picture hasn't changed. Is
there something else I'm supposed to do? Something that "refreshes" it?
In my searches I found a vague reference to what might be a similar
problem, but no solution.
[Non-text portions of this message have been removed]
-----
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/