index.html file as below: This HTML is compiled with Handlebars
<div id="svg"></div>
index.js file as below:
var s = Snap("#svg");
var bigCircle = s.circle(150, 150, 100);
When i executed my code. It is showing me following error:
TypeError: s.circle is not a function
Your problem is that you are trying to attach Snap to a div element, instead of an SVG element.
Try changing
<div id="svg"></div>
to
<svg id="svg"></svg>
You can always put the svg inside a div.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With