Answer the question
In order to leave comments, you need to log in
How to add a class to the label that the cursor is hovering over?
The problem is the following. There are several custom labels on the map, the code below, when hovering over any label, hangs a class on all labels at once.
myPlacemark.events
.add('mouseenter', function () {
$('.points').addClass('interested');
});
Answer the question
In order to leave comments, you need to log in
I found a solution, maybe it will be useful for someone.
myPlacemark.events
.add('mouseenter', function (event) {
let _this = event.get('target').getOverlaySync().getLayoutSync().getElement(); // Родительский контейнер html.
let pinner = _this.children[0]; // Вложенный элемент.
$(pinner).addClass('interested');
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question