Hey Rossko!
Thank you very much, you are genius!
I've changed to:
function createInfoWindow(marker, hotspot) {
return (function() {
infowindow.setOptions({
'content': hotspot.description,
'position': hotspot.position
});
infowindow.open(map,marker);
google.maps.event.addListener(infowindow, 'domready',
function() {
$('direction').addEvent('click', function(){
alert('clicked!');
});
});
}
);
}
and it seems to work now.
On Mar 23, 12:24 pm, Rossko <[email protected]> wrote:
> > I've tried to add an event to the direction span with mootools, plain
> > js, google.maps.event and nothing is working and I just can't
> > understand why???
>
> The infowindow content doesn't exist in the DOM until the API has
> created it, asynchronously.
> Try listening for the infowindow's domready event before attempting to
> access its content.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.