Calling Fancybox from Event Listener in Google Maps Instead of Default Infowindow -
i'm looking replace default google maps api infowindow fancybox overlay.
version
google maps api 3.0
goal
replace default infowindow fancybox popup
use case
- google map loaded in full screen (100% 100%)
- markers placed onto map
- user clicks on marker , shown fancybox popup overlays map
- user clicks on "x" in top right hand corner of fancybox close it
i'm @ loss how best tackle this. easiest call fancybox using addlistener event handler, passing in marker parameter? if so, how of recommend doing this?
for example:
google.maps.event.addlistener(marker, 'click', function(){ // call fancybox, how? }); thank in advance,
graham kennedy
i've found best way go pass in content manually fancybox's href method. works charm me.
function addmarker(data) { // build window contents var contentforbox = data; google.maps.event.addlistener(marker, 'click', function() { $.fancybox({ href: contentforbox // other options }); }); }
Comments
Post a Comment