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";
Était-ce utile?

La solution

Found the answer:

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

Autres conseils

Try paper rather than canvas, so..

svg_item.paper.id = "main_svg";
svg_item.paper.attr({ style: "pointer-events: none" });
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top