【发布时间】:2017-01-17 07:31:15
【问题描述】:
跟进 line break for d3 circle title tooltipText
代码是
svgContainer.selectAll("g.node").each(function() {
var node = d3.select(this);
var tooltipText = node.attr("name");
var tooltipText = node.attr("name").replace("\\n", "<br />");
if (tooltipText) {
node.select("circle")
.attr("data-html", "true")
.attr("title", tooltipText);
}
我想用 CSS 格式替换 .attr("data-html", "true") 函数
css,不工作-1:
# g.node circle { data-html: true;}
css,不工作-2:
# g.node circle { html: true;}
以上2个都有“未知属性名”错误。
我想知道,.attr("data-html", "true") 等价的 CSS 是什么?
非常感谢。
【问题讨论】:
-
data-html是一个属性,而不是 CSS 属性
标签: javascript jquery html css d3.js