开发者

calling facebox in a google maps balloon

开发者 https://www.devze.com 2022-12-27 21:53 出处:网络
I have a gmap balloon. var marker = createMarker(point, \'<div style=\"width:240px\" id=\"mapsball\"><h2>Splash of London</h2><img src=\"_assets/images/themes/shop.jpg\" id=\"map

I have a gmap balloon.

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);

and a facebox attached to the click event of the image ('#mapsball') which opens it in a facebox

$(function() {
    $("body").d开发者_开发知识库elegate("#mapThumb", "click", function(){
         jQuery.facebox('<img src="_assets/images/themes/shop.jpg" align="right"/>');

    });
 });

this works fine in ff and safari and chrome. but doesn't fire in ie. I don't get a js error in ie so I am assuming it just doesn't get binded. any help would be greatly appreciated.

I also tried the following but the same result:

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


Tried hard coding the event on the element (onclick="faceboxfunction();") and now it works.

0

精彩评论

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