繁体   English   中英

使用removeChild时,通过JavaScript移动SVG对象会阻止Touchmove事件。

[英]Moving SVG objects with JavaScript blocks the Touchmove event when using removeChild

当我尝试移动SVG对象时,使用removeChild()不能正常工作。 移动时它还会阻止touchmove事件。

伪代码:

id.addEventListener("touchmove", function(e) {
  if (selected == true) {
    e.preventDefault();
    moveY = y;
    var n = document.getElementById("test"); // remove nodes
    while (n.lastChild) {
     n.removeChild(n.lastChild);
    }
    test.appendChild(createElementNS...); // add it again
  }
}, false);

这不是SVG的问题,而是元素抑制的问题。 消息不再到达。 删除触摸开始”目标后,不触发“外观触摸移动”事件描述了问题并提出了解决方案

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM