Anonymous
06-16-2004, 01:59 PM
I'm making a html that displays a svg map with circles randomly placed.
There's a checkbox that toggles the display of the circles.
In the code to toggle, how do I loop through all the circles?
Right now the code looks like this:
var svgobj = document.embeds['theSVG'].getSVGDocument().getElementById(element_name);
if (!checkbox.checked){
// Hide layer.
svgobj.setAttributeNS(null,'visibility','hidden');
} else {
// Show layer.
svgobj.setAttributeNS(null,'visibility','visible') ;
}
This only does it for element_name. How do I loop through all of them?
Thanks!
There's a checkbox that toggles the display of the circles.
In the code to toggle, how do I loop through all the circles?
Right now the code looks like this:
var svgobj = document.embeds['theSVG'].getSVGDocument().getElementById(element_name);
if (!checkbox.checked){
// Hide layer.
svgobj.setAttributeNS(null,'visibility','hidden');
} else {
// Show layer.
svgobj.setAttributeNS(null,'visibility','visible') ;
}
This only does it for element_name. How do I loop through all of them?
Thanks!