slash12
2006-01-11 17:17:57 UTC
We've written an image annotation tool that allows you to annotate an
image, drawing arrows, circles, lines, and text on top of the image.
So we have event handlers that create new tags, that identify these new
elements on the fly, and insert them into the SVG DOM via javascript as
the user clicks on the picture.
This doesn't seem to be working in mozilla's SVG, however it does work
in IE using adobe's plugin. If I try to grab an element already in the
DOM, and make changes to it's attributes, this works fine, I just can't
seem to get new elements created in the DOM via javascript to show up.
Any ideas on ways that I can create these new elements so that they
show up in mozilla?
here's a little snippet of some of what I'm doing that doesn't seem to
be working:
var svgDocument = document.getElementById(embedID).getSVGDocument();
var w = svgDocument.createElement("circle");
w.setAttribute("type","circle");
w.setAttribute("cx",cx);
w.setAttribute("cy",cy);
w.setAttribute("r",r);
w.setAttribute("stroke",stroke);
w.setAttribute("stroke-width",strokeWidth);
w.setAttribute("fill","none");
svgDocument.rootElement.appendChild(w)
image, drawing arrows, circles, lines, and text on top of the image.
So we have event handlers that create new tags, that identify these new
elements on the fly, and insert them into the SVG DOM via javascript as
the user clicks on the picture.
This doesn't seem to be working in mozilla's SVG, however it does work
in IE using adobe's plugin. If I try to grab an element already in the
DOM, and make changes to it's attributes, this works fine, I just can't
seem to get new elements created in the DOM via javascript to show up.
Any ideas on ways that I can create these new elements so that they
show up in mozilla?
here's a little snippet of some of what I'm doing that doesn't seem to
be working:
var svgDocument = document.getElementById(embedID).getSVGDocument();
var w = svgDocument.createElement("circle");
w.setAttribute("type","circle");
w.setAttribute("cx",cx);
w.setAttribute("cy",cy);
w.setAttribute("r",r);
w.setAttribute("stroke",stroke);
w.setAttribute("stroke-width",strokeWidth);
w.setAttribute("fill","none");
svgDocument.rootElement.appendChild(w)