jquery - problems with google map displaying images in new window when using fancybox -
i having few issues fancybox , google maps(v3) when displaying contents of kml file.
when displaying balloon contains description, have thumbnail of image want display when clicked using fancybox. problem have when thumbnail clicked the fancybox displays browser spawns new window displaying full size image.
i know when kml file parsed href tags have target attribute added, i've tried remove once map has loaded, during same time attach fancybox link.
i ensure map has loaded before try: i.e.
function updatemap(surveyid){ var map; var myoptions = { zoom: 5, maptypeid: google.maps.maptypeid.hybrid }; var url = "https://myurl/feed/kml.php?action=survey&id=" + surveyid; map = new google.maps.map(document.getelementbyid("googlemap"), myoptions); var kmllayer = new google.maps.kmllayer(url); kmllayer.setmap(map); google.maps.event.addlistener(map, "tilesloaded", function(){ attachfancybox(); }); }
the attachfancybox() function looks this.
function attachfancybox(){ $("a:has(img)").fancybox({ "hideoncontentclick":true }).removeattr("target"); }
now work firefox other browsers (ie7+, safari, chrome) act mentioned above. there way can achieve displaying image in fancybox without spawning new window/tab??
many thanks...
excuse me, have no time full reconstruct case, may cause not target
, may cause google map script binds click
events a
tag? try unbind events before attach fancy box:
function attachfancybox(){ $("a:has(img)").unbind() .fancybox({ "hideoncontentclick":true }) .removeattr("target"); }
Comments
Post a Comment