Steve Litt
2017-05-05 13:17:53 UTC
Hi all,
I've pretty much got it down for clickmapping with SVG elements using
onmouseover, onmouseout and onclick to run Javascript from my HTML
file. Now I'm trying to do the whole thing inside my SVG file, for
simple stuff.
For instance, I have a text/tspan element and a rectangle. When I hover
the rectangle I'd like the text to change (perhaps from "init" to
"hovered").
A few questions:
In what program must I look at my SVG file in order to see the effects
of its internal javascript? Inkscape? Chromium? Something else?
When doing javascript exclusively from within my SVG file, what syntax
should I use in order to change the text in a tspan? The following
failed to work, doing nothing:
msg = document.getElementById(tspanmsg);
msg.node.textContent('shunk');
If I removed the "node." from the second line above, that didn't work
either.
Thanks,
SteveT
Steve Litt
May 2017 featured book: Twenty Eight Tales of Troubleshooting
http://www.troubleshooters.com/28
I've pretty much got it down for clickmapping with SVG elements using
onmouseover, onmouseout and onclick to run Javascript from my HTML
file. Now I'm trying to do the whole thing inside my SVG file, for
simple stuff.
For instance, I have a text/tspan element and a rectangle. When I hover
the rectangle I'd like the text to change (perhaps from "init" to
"hovered").
A few questions:
In what program must I look at my SVG file in order to see the effects
of its internal javascript? Inkscape? Chromium? Something else?
When doing javascript exclusively from within my SVG file, what syntax
should I use in order to change the text in a tspan? The following
failed to work, doing nothing:
msg = document.getElementById(tspanmsg);
msg.node.textContent('shunk');
If I removed the "node." from the second line above, that didn't work
either.
Thanks,
SteveT
Steve Litt
May 2017 featured book: Twenty Eight Tales of Troubleshooting
http://www.troubleshooters.com/28