Hello all,

This is my first time here. I've been using prototype.js for several
years now, and still love it :-) I've recently found a project named
Raphaël (http://raphaeljs.com) and started playing with it.

But I have a problem with the canvas svg element used by Raphael. 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, or any other Position methods for
that matter, 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>

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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to