Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle maps infobubble link click delegate() or live() doesn't work
    text
    copied!<p>I am using this custom window for balloon tips <a href="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/" rel="nofollow">http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/</a></p> <p>this is the code I have so far</p> <pre><code>var map; var ibs = []; function loadMap() { var latlng = new google.maps.LatLng(47.2175, 2.0614); // center of europe var mapOptions = { zoom: 2, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP, scrollwheel: false }; map = new google.maps.Map(document.getElementById("map"), mapOptions); var typeToIcons = { "STORE": "garnish/store-pin.png", "HOTEL": "garnish/hotel-pin.png" } placeMarker(new google.maps.LatLng(38.101063330, 23.810806274), "&lt;span class=\"logo\"\&gt;&lt;/span\&gt; &lt;h3\&gt;Kifissia&lt;/h3\&gt; &lt;div class=\"details\"\&gt; &lt;p\&gt;&lt;strong\&gt;Address: &lt;/strong\&gt;Foo 13, Athens, Bar, Ελλάδα (Αττική) Foo 13, Athens, Bar, Ελλάδα (Αττική) Foo 13, Athens, Bar, Ελλάδα (Αττική) Foo 13, Athens, Bar, Ελλάδα (Αττική)&lt;/p\&gt; &lt;p\&gt;&lt;strong\&gt;Telephone: &lt;/strong\&gt;23654632543&lt;/p\&gt; &lt;p\&gt;&lt;strong\&gt;Fax: &lt;/strong\&gt;27634734672&lt;/p\&gt; &lt;p\&gt;&lt;strong\&gt;Email: &lt;/strong\&gt; &lt;a href=\'mailto:gasds@ss.cc\' title=\'gasds@ss.cc\'\&gt;gasds@ss.cc&lt;/a\&gt; &lt;/p\&gt; &lt;/div\&gt; &lt;a href=\"http://localhost:8080/cocomat/location-item?id=1\" class=\"pop requiresJs\" title=\"Read more\"\&gt;Read more&lt;/a\&gt;", typeToIcons.STORE); placeMarker(new google.maps.LatLng(38.620449844, 21.410079002), "&lt;span class=\"logo\"\&gt;&lt;/span\&gt; &lt;h3\&gt;Αgrinio&lt;/h3\&gt; &lt;div class=\"details\"\&gt; &lt;p\&gt;&lt;strong\&gt;Address: &lt;/strong\&gt;Lam 56, Bla, TYY, Ελλάδα (Ηπειρωτική)&lt;/p\&gt; &lt;p\&gt;&lt;strong\&gt;Telephone: &lt;/strong\&gt;783487328&lt;/p\&gt; &lt;p\&gt;&lt;strong\&gt;Fax: &lt;/strong\&gt;7423893278&lt;/p\&gt; &lt;p\&gt;&lt;strong\&gt;Email: &lt;/strong\&gt; &lt;a href=\'mailto:jhjhdf@fuf.cc\' title=\'jhjhdf@fuf.cc\'\&gt;jhjhdf@fuf.cc&lt;/a\&gt; &lt;/p\&gt; &lt;/div\&gt; &lt;a href=\"http://localhost:8080/cocomat/location-item?id=2\" class=\"pop requiresJs\" title=\"Read more\"\&gt;Read more&lt;/a\&gt;", typeToIcons.STORE); geocode("International"); } function placeMarker(position, content, markerIcon) { var marker = new google.maps.Marker({ map: map, position: position, icon: markerIcon }); google.maps.event.addListener(marker, 'click', function() { for(var i in ibs) { ibs[i].close(); } var ib = new InfoBubble({ content:content, backgroundColor:"#F4F4F4", borderRadius:0, backgroundClassName:"infoBox bubble", disableAnimation:true, minHeight:250, maxWidth:232, arrowSize:15, arrowPosition:25}); ibs.push(ib); if (!ib.isOpen()) { ib.open(map, marker); } }); } // fit map bounds to selected country function geocode(country) { new google.maps.Geocoder().geocode({'address': country}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { // first result is the most specific map.fitBounds(results[0].geometry.viewport); } }); } $(function(){ loadMap(); $('body').delegate('.pop','click',function(){ window.open($(this).attr('href'), "locationItem", "scrollbars=1, toolbar=0, status=0, menubar=0, width=800, height=500"); return false; }); }); </code></pre> <p>The problem is that the delegate() function doesn't work. I've also tried the live()</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload