获得徽章 0
赞了这篇文章
赞了这篇沸点
<svg><use></use></svg>在IE下点击,event.taget居然是一个虚拟SVG元素实例,不是具体元素,于是很多DOM方法没法使用。需要使用event.target.correspondingUseElement作为目标target元素才行。或者在SVGElementInstance.prototype原型上打补丁,全局优化,例如:if (window.SVGElementInstance) {
SVGElementInstance.prototype.getAttribute = function (attributeName) {
if (this.correspondingUseElement) {
return this.correspondingUseElement.getAttribute(attributeName);
}
};
}。
SVGElementInstance.prototype.getAttribute = function (attributeName) {
if (this.correspondingUseElement) {
return this.correspondingUseElement.getAttribute(attributeName);
}
};
}。
展开
评论
14
赞了这篇文章
赞了这篇文章
赞了这篇文章
Electron