如何将我的元素数据放在cy之外的事件中

时间:2016-03-01 08:38:30

标签: javascript qtip cytoscape.js

如何访问cy函数外的元素节点数据?这是我的代码:

function cytoFunc(myJson){
var cy = window.cy = cytoscape({
    container: document.getElementById('cy'),
       // style
       // elements
}); // end of cy

cy.$('node').qtip({
  content: 'I want to insert element data here',
  position: {
    my: 'left center',
    at: 'bottom center'
  },
  style: {
    classes: 'qtip-bootstrap',
    tip: {
      width: 16,
      height: 8
    }
  }
}); // end of cy.qtip

} // cytofunc的结尾

1 个答案:

答案 0 :(得分:0)

如果您想要每个元素的粒度,请在每个元素上调用qtip。使用Beta