I have a tab which is meant to display a google map, however its not displaying the full map, i have done some googling and still unable to solve it. I beleive it has something to do with the fact it is in a jquery tab. How do i fix this?
This is what the html looks like including the surrounding divs;
<div id="details" class="det_tab1">
<ul class="head">
<li><a href="#" class="det_tab1">Property details</a></li>
<li><a href="#" class="det_tab2">Map view</a></li>
<li><a href="#" class="det_tab3">Street view</a></li>
</ul>
<div class="det_tab2">
<div id="map_canvas"></div>
</div>
And here is the javascript
<script type="text/javascript">
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom:8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = document.getElementById("map_canvas");
map = new google.maps.Map(map, mapOptions);
var center = map.get_center();
google.maps.event.trigger(map, 'resize');
map.set_center(center);
}
</script>
And the jquery;
$('#details .head a').click(function () {
if ($(this).attr('class') != $('#details').attr('class')) {
$('#details').attr('class', $(this).attr('class'));
}
return false;
});