Question

In Raphael it is easy to get the SVG root element:

svg_item = Raphael(0, 0, 3000, 3000);
svg_item.canvas.id = "main_svg";
svg_item.canvas.style.pointerEvents = "none";

but how this can be done in Snap.svg? The following doesn't work:

svg_item = Snap(3000, 3000);
svg_item.canvas.id = "main_svg";
svg_item.canvas.style.pointerEvents = "none";
Was it helpful?

Solution

Found the answer:

svg_item = Snap(3000, 3000);
svg_item.root.node.id = "main_svg";
svg_item.root.node.style.pointerEvents = "none";

OTHER TIPS

Try paper rather than canvas, so..

svg_item.paper.id = "main_svg";
svg_item.paper.attr({ style: "pointer-events: none" });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top