在谷歌地图气球中调用facebox

时间:2010-04-25 13:10:57

标签: javascript jquery maps facebox

我有一个gmap气球。

var marker = createMarker(point, '<div style="width:240px" id="mapsball"><h2>Splash of London</h2><img src="_assets/images/themes/shop.jpg" id="mapThumb" width="100" align="right" /><p>110-112 Hoxton Street</p><p>London</p><p>N1 6SH</p></div>');

    map.addOverlay(marker, icon);

和附加到图像点击事件('#mapsball')的facebox,它在面板中打开它

$(function() {
    $("body").delegate("#mapThumb", "click", function(){
         jQuery.facebox('<img src="_assets/images/themes/shop.jpg" align="right"/>');

    });
 });

这在ff和safari以及chrome中运行良好。但是不会发射。 我没有得到一个js错误,所以我假设它只是没有得到绑定。任何帮助将不胜感激。

我也尝试了以下但是结果相同:

if (map.isLoaded()){
        $(function() {
            $("body").delegate("#mapThumb", "click", function(){
                jQuery.facebox('<img src="_assets/images/themes/shop.jpg" align="right" />');
            });
        });
    }

1 个答案:

答案 0 :(得分:0)

尝试对元素上的事件进行硬编码(onclick =“faceboxfunction();”),现在它可以正常工作。

相关问题