Answer the question
In order to leave comments, you need to log in
How can I hang the ballonopen event with my function on the label using objecmanager?
How can I hang the ballonopen event with my function on the label using objecmanager ? When using placemark, everything looked like this
myPlacemark1.events.add('balloonopen', markopen);
function markopen(e)
{
var mark = e.get('target');
$.ajax({
type:'post',
url:site_url+'ajax/map/'+mark.properties.get('board_id'),
dataType:'html',
success:function(data){
//mark.properties.set('balloonContent', data);
mark.properties.set('balloonContentBody', data);
var params = ".ymaps-b-cluster-tabs__content-item";
var content = $(params).append(data);
$("#myImg2").css('display', 'none');
$(".jcar3").css('display', 'block');
$(function() {
$('.jcarousel3').jcarousel({
animation: 'slow'
});
// Прокрутка слайдера
// Кнопка PREV
$('.jcarousel-prev3')
// Триггер класса inactive
.on('jcarouselcontrol:active', function() {
$(this).removeClass('inactive');
})
.on('jcarouselcontrol:inactive', function() {
$(this).addClass('inactive');
})
// Инициализация кнопки PREV
.jcarouselControl({
target: '-=1'
});
// Кнопка NEXT
$('.jcarousel-next3')
// Триггер класса inactive
.on('jcarouselcontrol:active', function() {
$(this).removeClass('inactive');
})
.on('jcarouselcontrol:inactive', function() {
$(this).addClass('inactive');
})
// Инициализация кнопки NEXT
.jcarouselControl({
target: '+=1'
});
});
$(".to-card_button").click(function(){
//$('.ymaps-b-balloon__close').click();
if($("#successful_add").css("display") == "none")
{
$("#successful_add").css("display", "block");
$("#TB_overlay").css("display", "block");
}
if($("#successful_add").css("display") == "block")
{
$("#TB_overlay").click(function(){
$("#successful_add").css("display", "none");
$("#TB_overlay").css("display", "none");
});
}
});
$("#edit_location").click(function(event){
event.preventDefault();
$.ajax({
type:'post',
url:site_url+'main/edit/'+mark.properties.get('board_id')+'/1',
dataType:'html',
success:function(data2){
mark.properties.set('balloonContentBody', data2);
$(".edit-board-popup").html(data2);
}
});
});
}
Answer the question
In order to leave comments, you need to log in
For the ObjectManager object, events are hung up a little differently.
Look at this example: Yandex maps sandbox
That is, the handler is attached not to a specific label, but to all objects / clusters through:
objectManager.objects.events('eventname');
objectManager.clusters.events('eventname');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question