Hello all,

This was my first post here, but it looks like it has never been
actually posted (sorry if I should not post it again).

I have a problem with the canvas svg element used by Raphael
(raphaeljs.org). I don't know a lot about the way Firefox lets us
embed svg elements inside html documents, so I was surprised to find
that Element.viewportOffset doesn't work on the <svg> element, or any
other Position methods, while event handlers and several other js
things work as usual.

Take a look at this test page for Firefox 3.5:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html>
<head>
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/prototype/1.6.0.3/prototype.js"></script>
<script type="text/javascript">
Event.observe(window,"load", function (e) {
       var canvas = document.createElementNS("http://www.w3.org/2000/
svg",
"svg");
       canvas.setAttribute("width", "512px");
       canvas.setAttribute("height", "342px");
       $("container").appendChild(canvas);
       alert(Element.viewportOffset(canvas));
       alert(Element.viewportOffset($("test")));
});
</script>
</head>
<body style="margin:0px">
<div id="container" style="padding:10px;margin:20px"><div id="test"></
div></div>
</body>
</html>

"container" contains both the svg canvas and a "test" div, but only
"test" is supported by the viewportOffset method.

Why can't I get the offset of the canvas element? Is there a fix or a
workaround? What is special about the SVGSVGElement?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to