How to use jQuery inside google infowindow maps?

I want to show jQuery effects (show and hide div) inside Google InfoWindow maps, how can I do this?

+5
source share
3 answers

Despite the fact that I do not have a profile yet, this plugin → http://code.google.com/p/jquery-ui-map/ should provide the functionality that you are looking for.

Hope this helps! Good luck :)

+5
source

InfoWindow can accept a DOM object as content. So create it and then get a jQuery reference to it, for example:

var layer = document.createElement("div");
layer.innerText="Click to hide!";
$(layer).click(function(){ $(layer).hide('slow'); } );

infoWindow.setContent(layer); //something like this
+4
source

:

var marker = new google.maps.Marker({...})

//Create infowindow
var infowindow = new google.maps.InfoWindow({
    content: "Some content"
});

//Link infowindow to marker in map
infowindow.open(map,marker);

//Add a listener
google.maps.event.addListener(infowindow, 'domready', function() {
    $( '.gira' ).change(function(){alert('a')})
})

API Ref: , InfoWindow DOM

+2

All Articles