Google Map not working inside FancyBox (lightbox)
How do I get a Google Map to load inside the Fancybox lightbox? The map loads fine when not in the lightbox. I'm just using the standard Google maps code off their site:
<html>
<body>
<div id="map_canvas" style="width:100px; height:100px;"></div>
</body>
<script type="text/javascript">
function initialize() {
开发者_开发问答var myLatlng = new google.maps.LatLng(-36.8804280598958,
174.811848958333);
var myOptions = {
zoom: 13,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
panControl: false,
zoomControl: false,
scaleControl: true,
mapTypeControl: false,
scaleControl: false
}
var map = new
google.maps.Map(document.getElementById("map_canvas"), myOptions); }
function loadScript() {
var script = document.createElement("script");
script.type = "text/javascript";
script.src =
"http://maps.google.com/maps/api/js?sensor=false&callback=initialize";
document.body.appendChild(script); }
window.onload = loadScript;
</script>
</html>
精彩评论