google map embeds

This commit is contained in:
sanj 2011-01-02 17:17:37 +05:30
parent 671bef145a
commit 9af165358f

View File

@ -18,6 +18,21 @@ $(function() {
if ($('.imageGallery').length > 0) {
$('.imageGallery a').fancybox();
}
$('a').each(function() {
var t = $(this);
var href = t.attr("href");
if (href.indexOf("http://maps.google.com") != -1) {
var embedUrl = href + "&output=embed";
var iframe = $('<iframe />').attr("src", embedUrl).attr("width", "425").attr("height", "350").css({'display': 'none'});
var parentP = t.parents('p');
parentP.append(iframe);
t.toggle(function() {
iframe.slideDown();
}, function() {
iframe.slideUp();
});
}
});
});
</script>
</head>