Skip to content Skip to sidebar Skip to footer

Multiple Fancybox Google Map

How to put a popup fancybox with different content in different markers? I've managed to set up the fancybox but you can see that it is the same content for two markers. I would li

Solution 1:

Pass a 4th argument to addMarkerWithWindow() , e.g:

addMarkerWithWindow("Lemans", new google.maps.LatLng(48.006922, 0.20874), map,
                    'http://lemans.org');
addMarkerWithWindow("Paris", new google.maps.LatLng(48.856291, 2.352705), map,
                    'http://parisinfo.com');

Make the argument accessible inside the function:

function addMarkerWithWindow(name, coordinate, map, href) {
  //your code
}

and use it as href-option for fancyBox:

$.fancybox({
  maxWidth  : 800,
  maxHeight : 600,
  href      : href,
  type      : 'iframe'
});

Post a Comment for "Multiple Fancybox Google Map"