make sure maps dont load twice
This commit is contained in:
parent
2b53746209
commit
996435aab4
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user