我的网站使用 jQuery 1.7,我需要在灯箱中显示 google map 。
例如:http://dev.visualdrugs.net/mootools/gmapsoverlay/
你能帮我用 jQuery 做同样的事情吗?
谢谢
最佳答案
以下是有关使用 jQuery Colorbox 执行此操作的一种方法的一些说明的链接:
http://www.primecut.gr/2011/06/colorbox-with-google-maps/
这里有一些简单的代码。这需要 jQuery 和 Colorbox plugin (JavaScript 和 CSS)。
HTML
<a class="googleMapPopUp" href="https://maps.google.com.au/maps?q=south+australia" target="_blank">
View location map
</a>
JavaScript
$('.googleMapPopUp').each(function() {
var thisPopup = $(this);
thisPopup.colorbox({
iframe: true,
innerWidth: 400,
innerHeight: 300,
opacity: 0.7,
href: thisPopup.attr('href') + '&ie=UTF8&t=h&output=embed'
});
});
<强> Demo
关于jquery - 谷歌地图显示在 jquery 弹出窗口中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13597797/