I refactored the above code to use the slideToggle()
method instead of toggle("blind", 1000)
and that seems to have fixed the re-sizing of the iframe content. With this, I did have to recreate the map location center point so that it was located in the correct area of the iframe when expanded. The only noticeable bug is with my Opera 11.62 browser, it does not have the map location centered when the map is shown.
Here's the updated demo:
http://jsfiddle.net/T7jLf/
HTML:
<button class="button" value="Show map">Show map</button>
<div id="map">
<iframe class="map" width="280" height="280" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Google+Headquarters,+1600+Amphitheatre+Parkway,+Mountain+View,+CA&aq=0&oq=google&sll=42.916709,-83.631706&sspn=0.203156,0.303154&ie=UTF8&hq=Google+Headquarters,+1600+Amphitheatre+Parkway,+Mountain+View,+CA&t=m&ll=37.426752,-122.090421&spn=0.009543,0.011973&z=15&iwloc=&output=embed"></iframe>
<br /><small><a href="https://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=Google+Headquarters,+1600+Amphitheatre+Parkway,+Mountain+View,+CA&aq=0&oq=google&sll=42.916709,-83.631706&sspn=0.203156,0.303154&ie=UTF8&hq=Google+Headquarters,+1600+Amphitheatre+Parkway,+Mountain+View,+CA&t=m&ll=37.426752,-122.090421&spn=0.009543,0.011973&z=15&iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small>
</div>
<p>Some paragraph text can go here...</p>
CSS:
#map {
display: none;
}
.map {
margin: .5em .25em;
}
Script:
$(".button").on("click", function () {
$("#map").slideToggle("slow");
$(this).text($(this).text() == "Hide map" ? "Show map" : "Hide map");
});