【问题标题】:d3.js Transition on div not workingdiv上的d3.js转换不起作用
【发布时间】:2014-06-19 19:31:18
【问题描述】:

我尝试通过转换来更改 divs html,但没有让它运行。谁能指出我的错误:

工作正常:

d3.select("#tt").html(d.name+"<BR>"+d.group);

不工作:

d3.select("#tt").transition().html(d.name+"<BR>"+d.group);

【问题讨论】:

  • 您要转换文本吗?
  • 是的。没有文字 -> 过渡 -> 文字。
  • 所以在转换后你想显示文本 aaah..??

标签: d3.js transition


【解决方案1】:
d3.select("#tt").transition().html(d.name+"<BR>"+d.group); 

尝试使用 text() 函数代替上面的 html 函数。 如果它也不起作用,开发小提琴然后我们可以做点什么。

【讨论】:

  • 感谢您的帮助。但是,我想撤回我的问题:)。在 html/test 设置上应用过渡没有真正意义。我的解决方案是设置没有过渡的文本,将不透明度设置为 0,然后应用过渡淡入。
  • 好的。好吧,那是你的选择。
猜你喜欢
  • 2014-10-05
  • 2014-07-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-23
  • 1970-01-01
  • 2023-03-27
相关资源
最近更新 更多