Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery dont see onclick event on link inside infowindow in google maps v3

i have such problem that jQuery onclick event dont see click on link inside google map in infowindow.

Thats how my infowindow link looks like:

<a href="http://example.com/#ui-accordion-accordion-header-7" class="pull-right move-to-acc" id="itemH">See Details</a>

Under map i have acordion list with detailed information about point so im trying to catch click on that link move to accordion and open it - this is code i use to catch click event in infowindow:

jQuery("#itemH").click(function(event){
    alert("qq");
    });

When i click on marker infowindow open and i click on link but alert dont show up - im just moved to div #ui-accordion-accordion-header-7 If i put link outside the map jQuery catch click on link and display alert

What im doing wrong ?

Thx for help

like image 224
Charles Avatar asked Dec 27 '25 16:12

Charles


1 Answers

You may Use

jQuery(document).on('click', '#itemH', function(event){
    alert("qq");
});

instead of

jQuery("#itemH").click(function(event){
    alert("qq");
});
like image 90
The Alpha Avatar answered Dec 30 '25 05:12

The Alpha