0
所以我试图增加使用JavaScript的svg的stroke-dashoffset css,但是我无法获得任何svg路径的当前stroke-dashoffset。为什么style.strokeDashoffset总是返回空,即使设置了?
这里有一个jsfiddle使它在控制台中看到这样:
setInterval(function(){
path = document.getElementById("path1");
console.log(path.style.strokeDashoffset)
},50)
我怎样才能得到一个路径的计算CURENT行程dashoffset价值?