Label and Baidu Map Marker same location, Label click event does not take effect

The cause; Marker father elements box Z-index is greater than the father Label elements box; it Marker in the label above; lead to the click event does not take effect;

Processing method: set a custom label parent element after sliding the mouse 800 over Z-index; mouse after slipping to 400; otherwise, why not clickable marker;

如 :let label=new BMap.Label('<div class="myinputlabel"></div>')

$('.myinputlabel').parent().parent().parent().css({zIndex:400})
label.addEventListener('mouseover',function(){
$('.myinputlabel').parent().parent().parent().css({zIndex:701})
}) ;
label.addEventListener('mouseout',function(){
$('.myinputlabel').parent().parent().parent().css({zIndex:400})
}) ;
OK

Guess you like

Origin www.cnblogs.com/ypwei/p/11697170.html