Thanks, Martin, that did it.

I figured it was a closure issue, but I thought the 'this' would be in
the closure too, which it apparently isn't.


On Nov 25, 6:36 pm, Martin <[EMAIL PROTECTED]> wrote:
> How about:
>
> MyControl.prototype.initialize = function( map )
> {
>         this.controlDiv = document.createElement( "div" );
>         ...
>
>         var closeButton = document.createElement( "img" );
>         ...
>         var i=this.controlDiv;
>         google.maps.Event.addDomListener( closeButton, "click",
> function()
>                 {
>                         i.style.display = "none";
>                 }
>         );
>
> Get the required closure with a local variable.
>
> Martin.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to