0
的读取属性“getTotalLength”我有此SVG文字动画http://jsfiddle.net/thLvLkq0/2/SVG动画 - 错误不能为空
function init(i) {
path[i] = document.getElementById('path'+i);
length = path[i].getTotalLength();
path[i].style.transition = path[i].style.WebkitTransition = 'none';
length[i] = length;
path[i].style.strokeDasharray = length + ' ' + length;
path[i].style.strokeDashoffset = length;
path[i].getBoundingClientRect();
}
Chrome浏览器返回该错误消息Cannot read property 'getTotalLength' of null
有什么办法解决呢?我无法让它工作。
是的,你是对的!非常感谢你! – DMande
console.log是你的朋友:) –