如何从 SVG 地图路径获取属性值。我用了javascript
<object data="https://svgur.com/i/QXQ.svg" type="image/svg+xml" id="map"></object>
<script>
var a = document.getElementById("map");
a.addEventListener("load",function(){
var svgDoc = a.contentDocument;
var delta = svgDoc.getElementById("provinceMap");
delta.addEventListener("mousedown",function(e){
console.log(e["path"]);
}, false);
}, false);
</script>
跃然一笑
相关分类