【发布时间】:2012-05-17 18:12:27
【问题描述】:
谁能解释 google jquery.ui.map插件中的以下代码sn-p(jQuery.fn[name])的含义:
jQuery.each(('click mousedown rightclick dblclick mouseover mouseout drag dragend').split(' '), function(i, name) {
jQuery.fn[name] = function(a, b) {
return this.addEventListener(name, a, b);
};
});
还有我们如何将回调函数绑定到地图对象上的点击事件,我尝试了以下方法,但 event 没有 latLng 属性:
$('#map_canvas').gmap().click(function(event) {
alert(event.latLng);
});
提前致谢。
【问题讨论】:
标签: jquery google-maps-api-3 callback addeventlistener jquery-ui-map