谷歌地图显示在 jquery 弹出窗口中 [英] Google map displaying in jquery pop up window
本文介绍了谷歌地图显示在 jquery 弹出窗口中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的网站使用 jQuery 1.7,我需要在灯箱中显示谷歌地图.
I use jQuery 1.7 my web site, i need to show a google Map in a lightbox.
例如:http://dev.visualdrugs.net/mootools/gmapsoverlay/
你能帮我用 jQuery 做同样的事情吗?
Can you help me to do the same with jQuery.
谢谢
推荐答案
这里是一些使用 jQuery Colorbox 的方法的一些说明的链接:
Here is a link to some instructions on one way to do this using jQuery Colorbox:
http://www.primecut.gr/2011/06/colorbox-with-google-maps/
这里有一些简单的代码.这需要 jQuery 和 Colorbox 插件(JavaScript 和 CSS).
Here is some simple code to this. This requires jQuery and the Colorbox plugin (JavaScript and 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'
});
});
这篇关于谷歌地图显示在 jquery 弹出窗口中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文