我想在地图上的标签设置一个hover,我这边自定义的js代码是这样写的 function () {return '<span style="position: relative; display: inline-block;" ' +'onmouseenter="document.getElementsByClassName(\'tooltip_'+this.name+'\')[0].style.opacity = 1"' +'onmouseleave="document.getElementsByClassName(\'tooltip_'+this.name+'\')[0].style.opacity = 0">'+this.name+'' +'<span class="tooltip_'+this.name+'"'+'style="position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); ' +'padding: 8px 12px; background-color: #333; color: #fff; border-radius: 4px; ' +'font-size: 14px; opacity: 0; transition: opacity 0.3s ease;">Tooltip content' +'';} 但是我的鼠标移入和移出事件并没有生效。经测试,是无法点击到地图标签,只能点击到区域块上面 |