I've read other similar threads but nothing with a question / response which helps make it simple enough to understand what I need to do. I'm using jQuery version 1.7 which possibly explains why some of the code posted in other questions is dissimilar.
Google maps loads in a slideToggle'd div with the center point offset to the North West and not visible relative to the portion of the map which is displayed when the div is toggled open. I'm trying to get a very simple map to display, nothing fancy.
jQuery(".toggle").click(function () {
// check the visibility of the next element in the DOM
jQuery(this).next().slideToggle(); // slide it down
});
My jQuery knowledge is limited, but I understand I need to force the iframe to load after the div is toggled. I just don't know how to achieve this! The HTML / PHP code is as below.
<span class="toggle">
View Map // with some CSS
</span>
<div id="maps" class="ui-helper-hidden">
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=<?php echo $latitude;?>,<?php echo $longitude;?>&aq=&t=m&z=13&output=embed&key=123456789"></iframe>
</div>