代码语言:javascript复制
let liElArr = $('ol.queue-in li')
for(let i = 0; i<liElArr.length; i ) {
let item = liElArr[i]
let confidence = item.dataset.confidence
let color = item.dataset.color
new LeaderLine(
LeaderLine.mouseHoverAnchor(item, 'draw', {
animOptions: {
duration: 1000
},
hoverStyle:{
backgroundColor: null
},
// 起始点样式,这里为了清除默认样式
style: {
paddingTop: null,
paddingRight: null,
paddingBottom: null,
paddingLeft: null,
cursor: null,
backgroundColor: null,
backgroundImage: null,
backgroundSize: null,
backgroundPosition: null,
backgroundRepeat: null
}
}),
document.querySelector(`#firstCard [data-confidence="${confidence}"]`),
{
color: color,
size: 6,
hoverStyle:{
backgroundColor: null
},
// 起始点样式,这里为了清除默认样式
style: {
paddingTop: null,
paddingRight: null,
paddingBottom: null,
paddingLeft: null,
cursor: null,
backgroundColor: null,
backgroundImage: null,
backgroundSize: null,
backgroundPosition: null,
backgroundRepeat: null
}
}
)
}