使用的leader-line的片段代碼

   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
        }
      }
    )
   }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章