Google GeoCharts close tooltip on click

2020-05-02 02:51发布

问题:

I am using Google GeoChart and I have added a tooltip. When a user clicks on any state, then it will show the tooltip with state info. I need to add a close button in tooltip. When a user will click on the tooltip, then tooltip will close. I have added this code in the Fiddle.

function closetip(a) {
    //alert($(a).attr('id'));
    var cls = $(a).attr('id');
    $("#" + cls).parent().parent().parent().hide();
}