I use svg.js and svg.pan-zoom.js to make that svg can be zoomed using scroll. like svg.pan-zoom.js's demo (this)
This is my code, just for test.
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="jquery.js"></script>
<script src="svg.js"></script>
<script src="svgDraggy.js"></script>
<script src="svgPanzoom.js"></script>
<style type="text/css">
#drawing svg {
width:800px;
height:400px;
border:1px solid #333333;
}
</style>
</head>
<body>
<div id = "drawing">
<svg>
<g id="canvas">
<use xlink:href="space.svg#planet" fill="#19317c"></use>
</g>
</svg>
</div>
<script>
var test = SVG('canvas').panZoom();
test;
</script>
</body>
</html>
I used 'use' tag, because SVG what I want to use has complicated shape.
Maybe I have mistake svg select in script, but I don't know how to fix it.
Message in console is
svgPanzoom.js:129 Uncaught TypeError: Cannot read property 'tagName' of undefined
How can I fix it?