iframe is not loading google map

I am using google map in a popup coming through Fancy box where I had used type

 <script>
  jQuery("#menu-item-1670 a").fancybox({
                'width'             : '75%',
                'height'            : '75%',
                'autoScale'         : true,
                       'zoomSpeedIn': 300,
                      'zoomSpeedOut': 300,
            'overlayOpacity'    : 0,
                'type'              : 'iframe'
            });
</script>

but when I click on the google map then first time it shows map but when I try to click second time then it won’t show up..don’t know why?
here is the link I have tried to implement
http://kelts.wpengine.com/
property details tab->click on property map.->firsttime it shows->not second time.

Read More

tried but no luck!

Thanks!

Related posts

Leave a Reply

1 comment

  1. The second time I open the box, the src attribute of the iframe is about:blank. There’s a thread here that might fix the problem – it suggests storing the src using the onComplete callback, and restoring it with the onClosed callback.

    Not sure if it applies to your particular case, but it seems worth a try.

    If I’ve read that link and your source correctly, this should do the trick:

    <script>
       jQuery(document).ready(function() { 
          var mySRC ="";
          jQuery("#menu-item-1670 a").fancybox({
             'width'             : '75%',
             'height'            : '75%',
             'autoScale'         : true,
             'zoomSpeedIn'       : 300,
             'zoomSpeedOut'      : 300,
             'overlayOpacity'    : 0,
             'type'              : 'iframe',
             'onComplete': function() {
                // alert('onComplete called');
                mySRC = jQuery('#map_title iframe').attr('src'); 
             },
             'onClosed': function() { 
                // alert('onClosed called');
                jQuery('#map_title iframe').attr('src',mySRC); 
             } 
          });
       }); // ready 
    </script>
    

    If it works, dig out an answer by JFK and give him/her an upvote – it looks like he/she’s the source of the code.