我不确定问题的标题是否正确。看代码:
var trails = new Array(trail1, trail2, trail3, trail4, trail5, trail6, trail7, trail8, trail9, trail10, trail11, trail12, trail13);
var circles = new Array(circle1, circle2, circle3, circle4, circle5, circle6, circle7, circle8, circle9, circle10, circle11, circle12, circle13);
var texts = new Array(text1, text2, text3, text4, text5, text6, text7, text8, text9, text10, text11, text12, text13);
for(var i=0;i<=13;i++) {
$([trails[i].node,circles[i].node,texts[i].node]).qtip({
content: {
text: 'test qtip',
title: {text: 'test', button: 'close'}
},
position: {
target: 'mouse',
adjust: {mouse: false}
},
show: {
event: 'click'
},
style: 'qtip-rounded qtip-shadow qtip-blue',
hide: {
event: 'click '
}
});
}
在这个例子中,我在另一个数组中调用一个数组元素,所以我不确定它是否正确,否则当点击 circle[i] 或 text[i] 时 .qtip 将不会显示,但只有在 onclick 轨迹时才会显示 [一世]。还有一个 .node 属性使这个问题对于初学者来说更加复杂。有任何想法如何改进代码以使其工作?