make sure maps dont load twice

This commit is contained in:
sanj 2011-01-03 12:46:39 +05:30
parent 2b53746209
commit 996435aab4

View File

@ -22,10 +22,14 @@ $(function() {
var t = $(this);
var href = t.attr("href");
if (href.indexOf("http://maps.google.com") != -1) {
if (t.data("mapLoaded")) {
return false;
}
var embedUrl = href + "&output=embed";
var iframe = $('<iframe />').attr("src", embedUrl).attr("width", "425").attr("height", "350");
var parentP = t.parents('p');
parentP.append("<br />").append(iframe);
t.data("mapLoaded", true);
t.toggle(function() {
iframe.slideUp();
}, function() {