【问题标题】:d3 hover css stops working when the chart stops "ticking"当图表停止“滴答”时,d3悬停css停止工作
【发布时间】:2013-12-19 09:44:09
【问题描述】:

This fiddle demonstrates the problem with hover。基本上,当图表动画时,我的悬停类工作正常。但是一旦它稳定下来, :hover 就会停止工作。它也不仅仅是伪 CSS 类。我还尝试了 mouseOver/mouseOut 事件来添加/删除一个类。此方法也会停止运行。一旦你拖动一个节点,动画就会继续,悬停/鼠标悬停也会继续。

function tick() {
    path.attr("d", linkArc);
    node.attr("transform", transform);
}
//I had no idea what code to paste but it requires it with a linked fiddle.

【问题讨论】:

  • 在 Firefox 25.0.1 上为我工作
  • 废话。铬虫? :(
  • 看起来像。另外,IE11 在访问document 变量时会抛出permission denied 错误
  • 可能值得一提的是,该错误特定于 <foreignObject> 内容:替换为所有 SVG 元素 works fine。我注意到在another question 的 Chrome 中无法正确重新绘制foreignObjects 的问题。

标签: css animation svg d3.js hover


【解决方案1】:

这似乎是一个不错的解决方法:

setInterval(function () { tick(); }, 30);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-03-16
    • 2021-01-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多