开发者

GoogleMaps Overlay (floatPane) does not recive Click events

开发者 https://www.devze.com 2023-03-05 05:41 出处:网络
What do I need to configure to receive Click-Events in GoogleMaps Overlays? I have set up开发者_如何学Go a minimal Js-Fiddle Example here: http://jsfiddle.net/EsbEL/4/

What do I need to configure to receive Click-Events in GoogleMaps Overlays?

I have set up开发者_如何学Go a minimal Js-Fiddle Example here: http://jsfiddle.net/EsbEL/4/

I inherit my own class from google.maps.OverlayView which creates a DIV and attaches it to the maps floatPane.

In the example above i clone a DIV from the same site - Click Events work on the template but not in the Overlay-Div... Any Ideas?

Here is an other example I found on the net which shows jQueryUI as an Overlay: http://fiddle.jshell.net/5KVY6/302/ And this controls recive Clicks just as normal... and I dont find the difference.

EDIT: Sofar i have found that GMaps creates the overlay asynchronous, so my click handler for the link didnt get attached, it works with $(..).live, but I am still not able to click a button or enter text into a textbox; I have updated my example above.

Thx, Daniel


You forgot to add the click event to the copied content. Adding this code where getPanes() is just works

...
var panes = this.getPanes();  // yet exists
// example
$(this._div).click(function(){alert('here I am');});
0

精彩评论

暂无评论...
验证码 换一张
取 消