d3.js - d3 drag works but appear Uncaught TypeError: a.target.className.indexOf is not a function -
i practice use d3 drag svg circle around.
it works except following error appeared in console: "uncaught typeerror: a.target.classname.indexof not function"
what wrong code? following code:
<!doctype html> <html lang="zh-hant"> <head> <title></title> <meta charset="utf-8"> <script src="http://d3js.org/d3.v3.min.js"></script> </head> <body> <p> <svg width="300" height="200"> <circle cx="100" cy="100" r="5" fill="red" /> <circle cx="50" cy="70" r="5" fill="red" /> </svg> </p> <script> var drag = d3.behavior.drag() .on("drag", function () { d3.select(this).attr("cx", d3.event.x) .attr("cy",d3.event.y); }); d3.selectall('circle').call(drag); </script> </body> </html>
this because of google translate extension. disabling solves problem.
Comments
Post a Comment