我有一点问题
可以将事件CLICK添加到gmaps v3中标记中的链接吗?
var m = new google.maps.Marker({
map: map,
animation: google.maps.Animation.DROP,
position: position,
html: "<a id='link'>mylink</a>",
icon: '/images/repairer.png'
});
gmarkers.push(m);
$('#link').click(function () {
alert($(this).attr('data'));
});
google.maps.event.addListener(m, 'click', function () {
info_window.setContent(this.html);
info_window.open(map, this);
});
HELP
答案 0 :(得分:0)
$('#your_map_id').on('click', '#link',function () {
alert($(this).attr('data'));
});