选择时间轴项目'content'vis.js

时间:2018-01-04 13:28:56

标签: javascript timeline vis.js

有没有办法选择时间轴项目的“内容”?

timeline.on('select', function (properties) {
  alert('selected items: ' + properties.items);
});

这仅选择项目ID。这可以在vis.js内完成,还是需要使用像jQuery这样的东西?

2 个答案:

答案 0 :(得分:0)

我只是使用jquery来匹配每个项目的id。

答案 1 :(得分:0)

获取HTML内容

properties.event.firstTarget.innerHTML

获取文本内容

properties.event.firstTarget.innerText

相关问题